Massive memory leaks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I curently worked a bit with valgrind to find (and try to fix) some memory leaks inside the dedicated server code. After fixing some leaks that occured before the actual game start, I finally started the game, kept it running for 3-5 minutes, ended the game and finally closed the dedicated server.
I am far from being a professional memory leak finder, however when taking a look at the output of valgrind (see attached file), one major memory leak problem seems to be the loading of objects like immovables and movables from a savegame as well as the new creation of those.
It seems to me as if the allocated memory for those objects never gets freed.
In case I am right with this prediction, maybe it would be good to write every game objects pointer inside a list so it can be freed/deleted once the game object itself is destroyed in game - and finally to free/delete all remaining objects after closing the game.
tags: | added: memory |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
Sorry forgot to format the file properly. When you look at the stderr of valgrind, best directly scroll down to the end as the memory leaks are ordered ascending by size of leaked memory