Memory usage problem - 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: Memory usage problem (
/showthread.php?tid=406943)
Memory usage problem -
CONTROLA - 12.01.2013
Hey guys, I'm having some problems with my gamemode.. After some time online my server is using A LOT of memory and things are getting pretty laggy.. Like timers being late, MySQL SELECT queries being REALLY REALLY slow. Can you help me fix this? If this helps, I've got:
- I'm using the default command processor(strcmp) and I'm not using foreach
- I'm using .INI systems along with MySQL systems
- I'm using crashdetect(?)
- I'm using an objects streamer (~2000 objects)
Can you help me? And if you're kind, can you tell me which of these can cause problems?
Re: Memory usage problem -
DaRk_RaiN - 12.01.2013
The your second problem,use ZCMD+sscanf+foreach.
Re: Memory usage problem -
EAsT-OAK_510 - 12.01.2013
Specs on your host?
Re: Memory usage problem -
CONTROLA - 12.01.2013
I'm owning a VDS for the server so I think the host specs are enough:
3.5 GB of RAM
Intel Dual Core 3.3 GHz
I'm having ~150 players at once, and on my tests server(where there are maximum 5 players online) the server works perfectly even after a week online, things aren't getting laggy at all.
Re: Memory usage problem -
RedCrossER - 12.01.2013
Optimise your script , use zcmd + sscanf + foreach this will help to use less ram
Re: Memory usage problem -
liquor - 12.01.2013
Quote:
Originally Posted by CONTROLA
Can you help me? And if you're kind, can you tell me which of these can cause problems?
- I'm using the default command processor(strcmp)
- and I'm not using foreach
- I'm using .INI systems
|
That is what could cause your problems. And big strings like new string[256]; when you often never use half.
Really hard to tell without seeing any piece of code at all.
But it sounds like It's one or more loop(s) that doesn't stop when it's supposed to.
Post your OnPlayerUpdate aswell....