SA-MP Forums Archive
Script size, unknown amount of cells - 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: Script size, unknown amount of cells (/showthread.php?tid=557908)



Script size, unknown amount of cells - PaulDinam - 15.01.2015

Is this normal?

Header size: 15460 bytes
Code size: 629628 bytes
Data size: 1051372 bytes
Stack/heap size: 17039360 bytes; estimated max. usage: unknown, due to recursion
Total requirements:18735820 bytes

These are my includes:
#include <a_mysql>
#include <sscanf2>
#include <streamer>
#include <YSI\y_va>
#include <YSI\y_hooks>
#include <YSI\y_commands>
#include <YSI\y_timers>
#include <YSI\y_bit>
#include <foreach>
#include <h_colors>
#include <fixes2>
#include <strlib>


Re: Script size, unknown amount of cells - mahdi499 - 15.01.2015

Yes it's normal, due to the fact your usage fluctuates in the script based on different circumstances.


Re: Script size, unknown amount of cells - PaulDinam - 15.01.2015

Quote:
Originally Posted by mahdi499
Посмотреть сообщение
Yes it's normal, due to the fact your usage fluctuates in the script based on different circumstances.
Understood, I was like terrified looking at these numbers because i've worked some time on my script.


Re: Script size, unknown amount of cells - Ironboy - 15.01.2015

Optimizing your code can get rid of this but as said above its a normal stuff.


Re: Script size, unknown amount of cells - Vince - 15.01.2015

No, it's not normal stuff and it's not okay. Read:

Stack/heap size: 17039360 bytes
Total requirements:18735820 bytes

You're consuming approximately 18.7 megabytes of memory while your stack is "only" 17 megabytes in size. This means that at one point the stack will get corrupted and your server will most likely crash. At the very least you will experience some unexpected behavior where data has been overwritten.


Re: Script size, unknown amount of cells - CalvinC - 15.01.2015

It's not normal, it's a very high usage, you might want to optimise your script, or look for any high strings, repeating loops etc.


Re: Script size, unknown amount of cells - PaulDinam - 15.01.2015

It might be some repeating loops because my code very organized and im using three global strings.


Re: Script size, unknown amount of cells - Banana_Ghost - 15.01.2015

I'll be honest with you, the only time I've ever seen this problem, was with a string that was over it's size, it was a typo, I needed a 1800 cell string to write a long query, I mistyped and wrote 18000, which gave me exactly what you got.


Re: Script size, unknown amount of cells - PaulDinam - 15.01.2015

These are my only string variables.
new msg[200], gText[1024], gExtra[125], query[1024];

It might be because of my includes as well, perhaps..


Re: Script size, unknown amount of cells - PaulDinam - 15.01.2015

Is there any way to search for functions that repeat themselves? This might be the problem..

EDIT:
I fixed it by removing y_timers, it must have been collided with fixes2 include and the results are:

Header size: 15204 bytes
Code size: 622592 bytes
Data size: 1045564 bytes
Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion
Total requirements: 1699744 bytes