PDA

View Full Version : A Few Questions About Timers Memory Usage


Maxips2
27/07/2013, 06:30 PM
1) I'm aware that timers increase memory usage, but how bad is it?

2) By how much does the memory usage increase for every timer (running simultaneously)?

3) Is there a way to calculate how much memory a timer is taking?

4) Why do timers actually take memory (how does it work)?

Sorry for asking so many questions, I'm just curious.

MellowHammer
27/07/2013, 06:31 PM
I believe you should ask these questions here: http://forum.sa-mp.com/showthread.php?t=30938

Maxips2
27/07/2013, 06:35 PM
I believe you should ask these questions here: http://forum.sa-mp.com/showthread.php?t=30938

I don't think this is really the place for it, but if it is I'll post it there ofc.

Maxips2
27/07/2013, 08:13 PM
Any function uses memory, but really not a lot! The real question is why is this so important?

Well, there's something I am working on which updates some data every so often for each player.
I wasn't sure if it should be done with 1 timer for all players, or 1 timer per player.

I read your thread about timers again (I read it once before) and figured it would probably be best to have 1 timer per player to let the server sync.
But then I thought that it might be bad because it may drastically increase memory usage (worst case 500 timers running at once, actually 800 or 1000).

All of this got me to the thinking again that even if it will take quite a bit of memory, its better than letting the server hang for some time every 1 second.

EDIT: I was referring to this thread: http://forum.sa-mp.com/showthread.php?t=61322

Maxips2
27/07/2013, 08:38 PM
This is what profiling is for - you can't make any decisions like that without first confirming where your bottle-necks are (if you try guess you WILL get it wrong). However, I honestly think that you are drastically over-thinking things.

You are right, I always do that (over-thinking things), even when its about little things.

But regardless to what I'm trying to do, is the memory usage for many timers in general bad?

Maxips2
27/07/2013, 09:43 PM
I don't know:

Alright, thanks.