.Amx size 10mb - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: .Amx size 10mb (
/showthread.php?tid=316285)
.Amx size 10mb -
Feli97 - 06.02.2012
Hi all, I'm doing a GameMode by 0. Now it has reached 30.000 strings but its size is over 10mb, .pwn size is only 1.7 mb.
How can I make smaller amx size

GameMode is wrote in MySQL so there are some query strings which are 1000 characters.
P.S. Sorry for my bad english, I'm Italian.
Re: .Amx size 10mb -
Babul - 06.02.2012
the .amx stores all (empty) variables, so if you add a
pawn Код:
new PlayerInfoString[MAX_PLAYERS][128];
..then your gamemode will eat already 250 KBytes (500 players * 128*4 char).
there are a few ways to decrease the size:
-redefine MAX_PLAYERS to the real amount of your slots count in order to let the compiler create smaller arrays
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 40
-use the PVars, they dont waste memory, du they get created when required
Re: .Amx size 10mb -
Mark™ - 06.02.2012
check out the array sizes, you may have used huge values while creating arrays.