Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
Hi, I'm creating a TDM gamemode which has 2149 lines right now, but the amx is 6,19 mb. I have a gamemode with 45k lines and it's amx is like 3mb, I added there like 6k lines of code though. What could be causing this? Also I use a few includes (y_ini, sscanf, zcmd, foreach, progress2), everytime I add like hundred lines of code I get like 1mb. I'm scripting the same way I do on the 45k lines gamemode, but for some reason the TDM's amx is getting very high. The gamemode is OK thoughl, it's not even poorly optimized. What could be causing this problem?
Posts: 3,324
Threads: 96
Joined: Sep 2013
6.19 is "Huge"? Are you using a floppy?
Anyways, you probably have large arrays. Either that or an include does. It's not that big of a deal in this case unless you are using them poorly.
Posts: 3,324
Threads: 96
Joined: Sep 2013
If you want, I can personally look at your code in like half an hour. Just PM me. That'll be a lot easier than asking you questions about specific stuff. Then you can come here and tell everybody what the problem was if we find it.
Posts: 596
Threads: 75
Joined: Nov 2015
My 15k lines gamemode's .amx is of 1.15 MB :O
Posts: 3,324
Threads: 96
Joined: Sep 2013
Just to point things out... I can easily make a 2 line script that would be well over 6.19mb...
For example, the following would be around 10000kb (~10mb, and easily expandable to a lot more) because of the "arr[10000][1024]":
pawn Код:
new arr[10000][1024];
main() arr[0][0] = EOS;
And another example, I can easily make a 200k line script that is less than 1mb:
pawn Код:
new p;
addUpp() p++;
main() {
addUpp();
addUpp();
addUpp();
addUpp();
//... And more of "addUpp();" to make up 200k lines...
//...
addUpp();
addUpp();
}
And half that without the function call:
pawn Код:
new p;
main() {
p++;
p++;
p++;
p++;
// more "p++;"
// ...
p++;
p++;
p++;
p++;
}
Posts: 694
Threads: 2
Joined: Oct 2012
Reputation:
0
6MB is nothing, I've seen GMs with minutes of compile time and +40 MB size, That all comes back to the coding style of the one writing it.
You can try and conserve as much space as you can or you just can trade ram and space for cpu.