Page 1 of 1

LOVE memory using

Posted: Fri Aug 27, 2010 5:07 am
by rmn_rmn
Hi everybody!
I face a strange behavior of my game: sometimes it uses 160 mb, sometimes only 5 mb memory. What is the reason of such a difference? How can I force it to use 5 mb always? The game is small and 5 mb is it's reasonable usage.

Re: LOVE memory using

Posted: Fri Aug 27, 2010 7:49 am
by Robin
That is a very interesting question and we might have an answer if we could see the source of that game. :)

Re: LOVE memory using

Posted: Fri Aug 27, 2010 8:03 am
by rmn_rmn
Thanks, Robin. I should have uploaded it before. It is 70 percent ready at the moment, but should be enough to determine the source of the problem, I guess.
(In particular, online mode and sometimes artificial int. don't work properly.)

Re: LOVE memory using

Posted: Mon Aug 30, 2010 5:27 am
by Taehl
My best guess (having not looked at the code) would be runaway data. A "sorcerer's apprentice mode" bug. You mentioned AI, which I would consider the prime suspect. For example: Path-finding. You have it grow a table of paths until a suitable path is found. Well, if it can't find a path, the path table could potentially grow and grow and grow until...

Image

Re: LOVE memory using

Posted: Mon Aug 30, 2010 6:11 am
by Zeromuse
Just throwin stuff out there but I read something in the audio snippet (btw I'm new to LOVE)
http://love2d.org/wiki/Tutorial:Audio

If it is that then something having to do with the difference between static and steam use of your audio files. Like I said though, just throwin it out there.

Re: LOVE memory using

Posted: Mon Aug 30, 2010 10:20 am
by Lap
Didn't we already have the "Wow!" joke last month?

Re: LOVE memory using

Posted: Mon Aug 30, 2010 10:55 am
by Taehl
Two months ago. :P And hush, it was appropriate, and I'll probably never get to use that image again.

Re: LOVE memory using

Posted: Mon Aug 30, 2010 4:44 pm
by rmn_rmn
Hmm, I noticed the difference before the game mode, just running it and staying in the main menu. So the slow ai doesn't seem to be the reason.