Error compile.
#1

Hi,

Код:
Header size:          19432 bytes
Code size:          3302720 bytes
Data size:         21626308 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5177 cells (20708 bytes)
Total requirements:24964844 bytes
How to fix that?
Reply
#2

If you compiled your script with debug flags (-d3) or verbose information (-v) then that message will show up. If you don't have either of these set then it means that your script uses too much resources and that you should reduce the size of your local variables.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=55261
Reply
#4

Quote:
Originally Posted by LarzI
Посмотреть сообщение
This is what you need. Use this thread. Cheers LarzI. Rep+4

You need to reduce cell size where ever required within your game mode. Remember where it is required.

Example:

Lets consider you have this code.
pawn Код:
public OnPlayerConnect(playerid)
{
     new str[256],name[MAX_PLAYER_NAME+1];
     GetPlayerName(playerid, name, sizeof(name));
     format(str,sizeof(str),"Hello %s , Welcome to SA-MP Server." , name);
     SendClientMessage(playerid, -1, str);
     return 1;
}
In the above example the actual size required is: 58 (MAX_PLAYER_NAME+1 + String used in str = 25 + 33)

The corrected code should be:

pawn Код:
public OnPlayerConnect(playerid)
{
     new str[59],name[MAX_PLAYER_NAME+1]; // You can put 60 also. Not a big deal. But having 256 utilises lot of memory and it is too slow.
     GetPlayerName(playerid, name, sizeof(name));
     format(str,sizeof(str),"Hello %s , Welcome to SA-MP Server." , name);
     SendClientMessage(playerid, -1, str);
     return 1;
}
Reply
#5

But it's only string sizes?
Reply
#6

And does it hurt script, if this warning is?
Reply
#7

Strings are declared just like arrays, so more precisely it's how much memory you use in variables, ESPECIALLY arrays as they require a lot of memory if they have a lot of cell-data.
Reply
#8

Quote:
Originally Posted by audriuxxx
Посмотреть сообщение
And does it hurt script, if this warning is?
Eventually you will get a stack/heap collision which results in corruption of data due to variables being overwritten.
Reply
#9

I wanted to create a thread which is related to this information, but since there's already one I'll reply here.

In 0.3e, I had that pawn.cfg file to "pawno\" directory and I could see this kind of information (Header size, Code size, Data size, Stack/heap size, Total requirements), but when I switched to 0.3x even if I have that file, it doesn't show anything. Does anybody know why? I'd appreciate it!
Reply
#10

Quote:
Originally Posted by Dwane
Посмотреть сообщение
I wanted to create a thread which is related to this information, but since there's already one I'll reply here.

In 0.3e, I had that pawn.cfg file to "pawno\" directory and I could see this kind of information (Header size, Code size, Data size, Stack/heap size, Total requirements), but when I switched to 0.3x even if I have that file, it doesn't show anything. Does anybody know why? I'd appreciate it!
No clue at all. I switched and my -d3 compile option works just as intended and as before. Try re-installing (re-downloading) the server package and manually delete and make a new pawn.cfg with the options you want/need.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)