SA-MP Forums Archive
Is this bad? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is this bad? (/showthread.php?tid=83594)



Is this bad? - Dreftas - 26.06.2009

I compiled my script and i see this:
pawn Код:
Header size:      5120 bytes
Code size:      420904 bytes
Data size:     1077212 bytes
Stack/heap size:   16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 1519620 bytes
I see this first time, earlier script compiled and thats it, showed message that compile successfull.
estimated max. usage: unknown, due to recursion
Is this bad?

And what these all lines mean? Why they appeared just today?(i updated script).

P.S.
GameMode(8100 lines)
Some includes(+ ~3500 lines)
Total ~ 12000 lines



Re: Is this bad? - Andom - 26.06.2009

It means you used too mutch memory, it's like having mutch arrays with a hight amount in it, like using:
Код:
new string1[256];
new string2[256];
new string3[256];
new string4[256];
while you can also use:
Код:
new string[128];
It's not realy that bad, but your server(/players) can lag by using too mutch memory.

Here you can see how to optimise your arrays:
Код:
http://forum.sa-mp.com/index.php?topic=79810.0



Re: Is this bad? - Correlli - 26.06.2009

Just add this:
pawn Код:
#pragma dynamic 32000
and check the link that [NL]WackoX gave you.


Re: Is this bad? - Dreftas - 26.06.2009

Quote:
Originally Posted by Don Correlli
Just add this:
pawn Код:
#pragma dynamic 32000
What this does?


Re: Is this bad? - arnutisz - 26.06.2009

Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
I'm gonna quote a famous SA-MP scripting quote - READ THE PDF.

But as I doubt you'll do that...

Quote:

#pragma dynamic value
Sets the size, in cells, of the memory block for dynamic data
(the stack and the heap) to the value specified by the expression.
The default size of the dynamic data block is implementation
defined. An implementation may also choose to
grow the block on an as-needed basis (see the host program’s
documentation, or the “Implementer’s Guide” for details).

There is some information. Simple, right?


Re: Is this bad? - Correlli - 26.06.2009

Quote:
Originally Posted by Dreftas
Quote:
Originally Posted by Don Correlli
Just add this:
pawn Код:
#pragma dynamic 32000
What this does?
It will set timer which will destroy your script in 32000 miliseconds. :P
What do you think it does? It solves your problem about memory size, of course.


Re: Is this bad? - Andom - 26.06.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by Dreftas
Quote:
Originally Posted by Don Correlli
Just add this:
pawn Код:
#pragma dynamic 32000
What this does?
It will set timer which will destroy your script in 32000 miliseconds. :P
What do you think it does? It solves your problem about memory size, of course.
Yes it solves it, but not on the good way, if you want a lag-less server try ******'s mothode.