UFO:Alien Invasion
Development => Coding => Topic started by: Muton on December 04, 2011, 08:49:52 am
-
Because of lot map errors
i tried some time ago to loop trough all maps and check for errors.
(attached patch [cli command maptest])
There are 2 problems so far
one major is
if you call cli
map day +africa
your available ram is decreasing each time you call a map.
Ive tested this on Win32 and on a fresh debian linux
On windows all ram is used even the swap and than the game run extremely slow
On Linux the ram isnt used much but the swap space used increase until the game simply crash
Im not sure what is causing this
because on windows (im a winuser) ufo.exe dont consume more ram.
Just the system consume more and more ram.
-
there is already a unittest for this. did you check whether it's the same there, too - otherwise you might have missed some cleanup function call.
src/test/test_mapdef.c (compile the c::b target testall)
-
There is a memleak!
tracker 3454274 (https://sourceforge.net/tracker/?func=detail&aid=3454274&group_id=157793&atid=805242)
On a landing mission the memory usage increase!
Just shoot down a ufo and save the game
send a landing team an restart the mission (dont abort the mission, just restart [loop 10 times])
Mem used increase ...
Now abort the mission and reload the savegame and start the mission
abort -> load the savegame -> start the mission (loop 10 times)
Mem used increase ...
use cli command
map day +africa (loop 10 times)
mem used increase ...
@testall
testall doesnt test all.
There is a black hole in africa but testall isnt reporting any error.
Or report any
ERROR: CM_InlineModel: Error cannot find model '*4'
"real world" error.
Even worse
testall does crash (if called from source) or stop (idle) working (if called from ufoinstall) on error
Running Test : testMoveEntities
ERROR: Couldn't load maps/test_routing.bsp
testall.exe --enable-all --console --log
logs attached
The reason why is well known 4me
Shutdown server: Server crashed.
Ive seen this error often and than a
map day +bla
call isnt executed
Tried (source) a lot of things to restart the server
but without luck. (doxygen link returns 403 error)
So i leave it to you .. :)
-
maybe the console command mem_stats helps to tackle it down
-
I lend my anecdotal support to this. I have noticed before if I play the game for more than 20-30 minutes, it has caused extreme slow-down in my system. I don't know anything about memory leaks, but I have definitely experienced this problem when I play the game for longer periods (which is not too often anymore).
-
mem_stats shows no unusual mem usage
but valgrind does.
attached
Because this is beyond my scope ...
-
the problems that your valgrind log is showing here are problems in zlib and mesa - not in ufoai
-
Yesterday i tried to find the root of the problem, but ....
Googling the memleak lead to an explanation
Its a handle-memleak
On windows
after running the game and loading a map
procesexplorer reveals >900 open handles
during reloading handles are released and again opened
If i do this in a loop i can see more handles are opened than released
in the end there are more than 1200 handles open
I than took a look into the code to pinpoint the problem
Followed functions
SV_Map->SV_InitGame->SV_InitGameProgs->TH_MutexCreate
SV_ShutdownGameProgs and TH_MutexDestroy is also called
Hard to follow all this functions!
Is there a doc that shows what function is called when ...
http://ufoai.ninex.info/doxygen/ = 403
-
http://ufoai.ninex.info/wiki/images/Callgraph.png
but i doubt that it'll help a lot in this case
-
I am not an coder or expert my newbie opinion is that trying new stuff with Quake 2 engine is harder and there is greater chances for glitches, bugs that could eat up alot of ram, proccesor, graphic card... Idk why dont you use Quake 3 engine :P
-
Because when project was started there was no Quake 3 sources?
The Id tech 3 was released on August 19, 2005, the first tech demo of UFO:AI was done near February 2004.
And now rewriting the game simply kills the project.
Also, some Id tech 3 features are in ufoai already, and even more.