Memory leak after several days of use.

I've had my copy of GC2 open playing a large game since 1.1 came out. Over the last few days I've noticed alt-tabbing back and forth was taking progessively longer. Finally after the last time I tabbed back tonight I saw a note that windows had enlarged my page file. Task manager showed ~5-600mb in use by various processes (GC2 ~- 300m) and a commit charge of 2.4gig. I exited the game, commit charge dropped to 600m. Resumed it, taskman lists GC2 at 680m and commit charge at 1.3g.

PS, as an asside, why does the total memory listed in the process tab of taskman rarely equal the number listed under commit charge?
6,380 views 10 replies
Reply #1 Top
The commit charge includes memory that was allocated and swapped out to disk.

As an application requests RAM from the O/S, virtual memory is given to the application. Some of this virtual memory is backed up by physical RAM, but as the physical RAM runs out the swap file is used and extended (on your hard disk) to back up the virtual memory that doesn't fit in physical RAM.

You can actually see the Physical and Virtual amounts in task manager, but it doesn't display this by default.

In Task manager, go to view / select columns and check the boxes, "Memory usage" and "Virtual memory size".

Yes, GC2 uses too much RAM. There is a hard limit in Windows XP of 2GB for Virtual RAM. Any allocation attempt for more than this will fail, even if you have 4GB of physical RAM and 4GB of swap file. The practical limit is also actually lower then 2GB because of fragmentation issues.

I would love to see an explanation of why so much RAM is required. I suspect it isn't required and in the end they'll fix the code and it will use a lot less RAM.
Reply #2 Top
Why would you leave the game running for *days*? Just exit the game when done for the day and then relaunch and you should be all set. I'd harbor a guess that just about any program left running for days at a time will start to eat up memory.
Reply #3 Top
I think this is total B.S. This game was supposed to be in line with the quality of the game for the price. Everyone is making a big stink about the $10.00 savings cause it isn't MP. Big Fricken Deal. What you got here boys and girls is a crappy patch that brings 32 bit systems to their knees with a memory leak the size of the titanic. You shouldn't have to have 4-12 times the amount of ram/pagefile usage as you ADVERTISE in your FAQ. I.E. 256 MB RAM recommending 512 MB. I'm loading this game, and it's only eating about one third to one half of my 640 MB RAM. But it's loading the pagefile up over a Gig. I have a 60 GB HD and about 55 GB is filled up. This is also BS. You said have about 1-2 gigs ready for the install. Thats a given but another 1-2 gigs for swap file give me a break. Where is this mentioned on the site for the digital DL? Bottom line I feel ripped off. Stop Alienating your customer base by releasing bad patches/products that dont perform up to their advertising. A memory leak that causes crashes is bullshit.
Reply #4 Top
I'd harbor a guess that just about any program left running for days at a time will start to eat up memory.


You don't understand what a memory leak is. A memory leak is a bug in code where memory is allocated but never returned to the system when it is no longer needed. A typical program may have memory allocated and given back numerous times as variables are created and destroyed. If the memory is not given back when they are suposedly destroyed and then more is allocated when they are created and not given back again, you lose memory and hence have a "leak". This continues until the system no longer has memory to give. This is a simplistic view of a leak but is essentially correct. A program with memory leaks will use more memory the longer it runs. A program without memory leaks will not except for needing more for specific operations that you are doing. The point is time running really only affects a leak. This does not mean that the only way to run out of memory is via a memory leak as inefficient code and just too little memory to do the operation will also do it.

Dan: While I agree with some aspects of your post and understand and share your frustration, you could be a little more tactful. The developers are currently working through the issues and hopefully will resolve them. As long as they are attempting to fix the problems, they don't need people screaming at them. I do acknowledge your right to complain on the issue which I am sure other posts will not do as you will probably be flamed for your comments. I just feel you could do them in a better way.
Reply #5 Top
Why would you leave the game running for *days*? Just exit the game when done for the day and then relaunch and you should be all set. I'd harbor a guess that just about any program left running for days at a time will start to eat up memory.


30-45s alt tab time on a large vs 2m+ to load, and a similar price to shut down. My pc's always on, so there's no reason to waste time restarting apps unnessarily. And depending on the app memory loss is often slow enough not to be an issue.

The loss rate for GC2 is slow enough that it might not be a failure to clean up allocated memory as AlfB suggested but heap fragmentation, which is where as memory is repeatedly re and deallocated what's left free gets broken into unusably small peices scattered between other allocated objects. There're ways to mitigate this with custom memory management including either garbage collection of some sort to compact the heap, or the use of multiple heaps sorted by size and lifetime. The former isn't really an option though since a full GC on several hundred megs will bring even a powerful system to it's knees. the persistance arts of the latter would be very difficult to retrofit since they'd require an additional parameter passed during every new operation indicating expected lifetimes.
Reply #6 Top
Several DAYS and he's complaining I can play for say 6 hours and never had a problem. As a long time gamer, I tend to occasionally : save / close game / take a break anyway but I'd say a game that can run 6 hours without a problem is WAD and I'm not bitching.
(I'm not saying the game doesn't have a few bugs but sheeesh.)
Reply #7 Top
30-45s alt tab time on a large vs 2m+ to load, and a similar price to shut down. My pc's always on, so there's no reason to waste time restarting apps unnessarily. And depending on the app memory loss is often slow enough not to be an issue.


What? Sorry, but any app constantly on will probably have a problem. Plus the game doesn't like being alt+tabbed. Play in windowed, this stops a lot of load issues. I get instant alt+tabbing and near-instant (8 second) save times. Load varies, usually 20 secs for huge.
Reply #8 Top
My pc's always on, so there's no reason to waste time restarting apps unnessarily.


Maybe you should re-evaluate this policy.

It's one thing to say that an app that crashes frequently every hour is buggy. But if you've got a game that's been running for several days straight, and it crashes becuase of a memory leak/virtual memory fragmentation... I'm sorry, but that's not something that the developers need to fix.

Now, they definately need to look into the memory problems, but much moreso for the acute cases, not because you decided to leave the game running on your machine forever.
Reply #10 Top
Alfonse, I agree this is only a priority three,or possibly two issue, depending on how much of the user base has 512megs or less of ram, but I haven't ran across any CTDs since the official patch came out. Anyway form the link SuperGeek provided the devs are taking this issue seriously, and it's personally gratifying that I managed to correctly guess what type of memory problem was going on.