11.01.2015, 21:15
Firstly: I know that this looks really really stupid, but I needed to test this plugin under really heavy stress (lots of huge string writing per second), because I have a thing in my mind to script in the future which uses this plugin a lot (SetGVarString), and I want to be sure it handles lots of messages being written in memory.
Code:
(gsBigString is a string with size ~8300, currently around 7300 characters were used to be written)
When I first "loadfs" in console, it writes fine in memory (verified using task manager), but after few more "reloadfs", it takes only few more kilobytes/megabytes (which is ok), but after ~10 "reloadfs" it starts giving these:
over and over without it crashing the server. I see that this is also a sampGDK problem.
(if I use just one big loop with that gsBigString, it starts giving errors after a few thousands, but at ~90000 (maximum at 99999) it crashes the server)
When I tried it with a timer:
it crashed after "221102":
(I had more RAM available, 5gb were used out of 8gb)
I want to know if this can be solved, or if I should stay at testing it less agressive.
Code:
pawn Код:
for( new i = 0; i < 10000; i ++ )
{
SetGVarString( "HugeMessageForShowOff", gsBigString, i );
printf( "%d", i );
}
for( new i = 0; i < 10000; i ++ )
{
SetGVarString( "HugeMessageForShowOff", gsBigString, i );
printf( "%d", i );
}
When I first "loadfs" in console, it writes fine in memory (verified using task manager), but after few more "reloadfs", it takes only few more kilobytes/megabytes (which is ok), but after ~10 "reloadfs" it starts giving these:
pawn Код:
[11/01/2015 23:36:57] [debug] Run time error 7: "Stack underflow"
[11/01/2015 23:36:57] [debug] Stack pointer (STK) is 0x4076BC, stack top (STP) is 0x4076BC
[11/01/2015 23:36:57] [debug] AMX backtrace:
[11/01/2015 23:36:57] [debug] Run time error 7: "Stack underflow"
[11/01/2015 23:36:57] [debug] Stack pointer (STK) is 0x4076BC, stack top (STP) is 0x4076BC
[11/01/2015 23:36:57] [debug] AMX backtrace:
[11/01/2015 23:36:57] [debug] Run time error 7: "Stack underflow"
[11/01/2015 23:36:57] [debug] Stack pointer (STK) is 0x4076BC, stack top (STP) is 0x4076BC
[11/01/2015 23:36:57] [debug] AMX backtrace:
[11/01/2015 23:36:57] [debug] Run time error 7: "Stack underflow"
[11/01/2015 23:36:57] [debug] Stack pointer (STK) is 0x4076BC, stack top (STP) is 0x4076BC
[11/01/2015 23:36:57] [debug] AMX backtrace:
[11/01/2015 23:36:57] [sampgdk] error: Too many callback arguments (at most 32 allowed)
[11/01/2015 23:36:57] [debug] Run time error 7: "Stack underflow"
[11/01/2015 23:36:57] [debug] Stack pointer (STK) is 0x4076BC, stack top (STP) is 0x4076BC
[11/01/2015 23:36:57] [debug] AMX backtrace:
[11/01/2015 23:36:57] [sampgdk] error: Too many callback arguments (at most 32 allowed)
(if I use just one big loop with that gsBigString, it starts giving errors after a few thousands, but at ~90000 (maximum at 99999) it crashes the server)
When I tried it with a timer:
pawn Код:
SetTimerEx( "WorkTimer", 2_000, 0, "i", 0 ); // OnFilterScriptInit
forward WorkTimer( number );
public WorkTimer( number )
{
for( new i = number; i < number+10000; i ++ )
{
SetGVarString( "HugeMessageForShowOff", gsBigString, i );
printf( "%d", i );
}
number = number+10000;
SetTimerEx( "WorkTimer", 2_000, 0, "i", number );
return 1;
}
pawn Код:
[11/01/2015 23:52:15] [debug] Server crashed while executing maps.amx
[11/01/2015 23:52:15] [debug] AMX backtrace:
[debug] #0 native SetGVarString () from gvar.DLL
[debug] #1 000018ec in public WorkTimer (0x00035b60) from maps.amx
[11/01/2015 23:52:15] [debug] // no information being printed at this debug
I want to know if this can be solved, or if I should stay at testing it less agressive.