Memory leak evidence? 1000 turn game research.

pchem

Chieftain
Joined
Aug 6, 2006
Messages
40
I recently discovered how to have the AI play a game against itself, where you only spectate, thanks to a fall further mod thread (044 progress report). This seemed fun, so I set up a small map erebus world game. I had previously enabled cheat/debug codes via chipotle in the ini file, and used ctrl-z to get a non-fog view at the start of the game. I then used the console (~) and the game.aiplay command ("help" for a list) to run the game autonomously. In 100 and 200 turn batches, I ran the game on its own for 988 turns. At this point, I saved the game. Save attached.

I then noted the memory usage in winxp's task manager, which was 840,760K. I returned to the game, and then hit "enter" for next turn. I timed how long it took to process the turn from hitting enter until I had the option to control my next unit. It took 15.4 seconds.

I then closed Civ4, reloaded it, loaded the save game, and repeated the process. The game took 513,956K of memory (after the turn -- 480M before, presumably some things had to be loaded to process the turn), and 12.4 seconds to process the turn.

This was using 0.40q on a modern computer with a fully patched, clean, recently reinstalled WinXP SP3. 4gigs of physical RAM and an E8400 CPU, and a Radeon 4870. dxdiag summary attached.

Therefore, I contend that there is some kind of memory leak which degrades performance in the latest FFH2. Of course, I don't know if it's in the base Civ4:BtS or the mod itself. mods, feel free to merge this with the bug thread, but as it's kind of a large report I put it here.

Oh, and the ability to have the AI play against itself while you watch is really darn cool. It's entertaining, educational, and a neat testing tool.
 

Attachments

It's very likely in BTS. Civ4 has always had some amounts of memory issues, not even talking about the number of entities it needs to track the longer the game progresses.
 
Test BTS and see what you get?

I was kind of hoping this thread would inspire testing by other players, because if I reproduce this in BTS, people could quite plausibly start questioning my windows install, or my hardware's drivers, etc. I've got the ball rolling... someone else please test in BTS and/or FFH2 :)
 
There have been memory leak discussions w/r/t CIV since the first release, and I kind of doubt it has ever been fixed. The intuitive sense says that for a game that really doesn't demand too much of the high-end system, it sure eats up the resources. Nice to see the test; however, I'm pretty certain that the leak is in the base CIV code, and not merely BTS. But that's a non-programmer observer's intuition.
 
A memory leak means that some memory is allocated and then not released correctly. The OS is still thinking that the memory is in use and wont let any other program/process allocate it for a new use.

If you would have a memory leak then after turning the game off the memory should still be allocated and your RAM should not go back to the state it was before the games was started.

Usually an increase in RAM consumption is over a period of time is not a consequence of a memory leak [but it can be], it is just Windows/game it self not managing juggling with the pieces of memory available to it. Almost all programs witch use the virtual memory while running will have this problem. Restarting civ from time to time should be a good habit. [or just play shorter but more frequently :)]
 
As others also points out, this is a Civ-issue, not FfH2. It has been improved with BtS and the last patches, but it is still recommended to reload the game if it get too slow (no need to restart the entire game, exit to main menu is enough).
 
Provided you can do that and not get a CtD. I have not had one lately but used to, every time. I did start to play smaller games so maybe that was the issue.
 
That explains why I always get crashes in my 1000 turn marathons =D
 
Back
Top Bottom