Page 1 of 1

[FIXED] Windows XP: Memory Full

Posted: 10 Aug 2006, 22:10
by AxlTrozz
When i start the game, use like couple of megs of memory, but with the time increase the memory up to the top (little by little), Windows launch the popup that say "Low Memory" , when i close the game all the memory is released.

ManaWorld Version: 0.0.20 Date: 23/07/2006
Microsoft Windows Xp Pro Version 2002, Service Pack 2
Pentium M 1.73 Ghz
768 RAM

I can reproduce the error every time i launch the game.

Posted: 10 Aug 2006, 22:50
by Modanung
And you're using the latest version of TMW?

yep, a few days ago..

Posted: 10 Aug 2006, 23:00
by AxlTrozz
Version: 0.0.20 Date: 23/07/2006

Posted: 10 Aug 2006, 23:55
by Crush
Ha! And you all said that memory leak at map change would just be my (or my task managers) imagination.

Some weeks ago i noticed that the memory usage of tmw goes up by several mb at every mapchange. doener (who uses linux) couldn't reproduce it and we didn't found an obvious memory leak in the functions that are important for map changing either. so we thought it would be my task manager seeing things.

but it could be possible that the memory leak only occurs on windows. i hope that's not the case because it would mean we are really screwed. we got no platform dependent code in the map changing routine. so the bug has to be in one of the 3rd party libraries or - even worse - in the winapi (although that's unlikely). and that will be very difficult to find and even more difficult to fix.

but don't worry, sooner or later we will find a solution.

Posted: 11 Aug 2006, 00:17
by Modanung
Crush wrote:Ha! And you all said that memory leak at map change would just be my (or my task managers) imagination.
I didn't. :roll:

Update..

Posted: 11 Aug 2006, 23:11
by AxlTrozz
Well, now i find something new

The processor also is at 100% permanently during im playing the game, but when i minimize the game release the load in the processor, and the memory stay the same until i continue playing then the memory continue increasing...and the processor at 100%

Posted: 12 Aug 2006, 00:05
by Crush
that's what could be expected.

Re: Update..

Posted: 12 Aug 2006, 10:35
by Modanung
AxlTrozz wrote:The processor also is at 100% permanently during im playing the game.
Name one game (without a frame rate limiter) that doesn't. If you don't want your CPU to be fully used all the time you can set a frame rate limit in the config file.

Re: Update..

Posted: 12 Aug 2006, 16:24
by Crush
Modanung wrote:Name one game (without a frame rate limiter) that doesn't.
Minesweeper :)

Re: Update..

Posted: 12 Aug 2006, 18:39
by Modanung
Crush wrote:
Modanung wrote:Name one game (without a frame rate limiter) that doesn't.
Minesweeper :)
Actually it has a fps limiter in the way it doesn't draw new frames if it doesn't need to. :P

Posted: 13 Aug 2006, 02:52
by Crush
It got a completely different approach as it is an event based WinAPI application. That means (very simplified) that it only draws things that change or have to be redrawn because they were hidden by another window.

Not like typical game engines that redraw the screen all the time without considering that parts of the screen or maybe the complete screen might look completely like the last frame.

Posted: 31 Aug 2006, 14:09
by Crush
update:

We found out that the memory leak only occurs with OpenGL enabled. That will make it a lot easier to find the bug. In the meantime all Windows user should disable OpenGL support by opening the config.xml in the tmw folder with a text editor and changing the value of the option name="opengl" from "1" to "0".

Posted: 31 Aug 2006, 15:43
by ElvenProgrammer
You should be able to disable it also by using the setup window

Posted: 07 Sep 2006, 20:30
by Crush
Björn Steinbrink (doener) was able to find and remove the memory leak. The reason was that opengl textures were not freed properly. You can download the fixed version from the svn or wait for the next version.

Thanks to everyone who helped to spot this bug.