View Issue Details

IDProjectCategoryLast Update
0001409AI War 1 / ClassicGameplay IssueNov 16, 2010 6:16 pm
ReporterTechSY730 Assigned Tokeith.lamothe  
Status resolvedResolutionfixed 
Product Version4.033 
Summary0001409: High Memory Usage
DescriptionI know that you intentionally made the game use allocate alot of memory right off the bat so the garbage collector won't run ridiculously often until it sizes the heap right.
However, about 900MB right after program startup? Don't you think that is a little much? Is there anything that can reduce this some without incurring overzealous garbage collection?
TagsNo tags attached.
Internal Weight

Activities

keith.lamothe

Nov 16, 2010 2:39 pm

administrator   ~0003733

The game is only holding on to _maybe_ 250MB of managed memory after loading an early-middish game (generally less). The "get the gc off our back" allocation is returned to the available pool after the first GC because we null out our references to the allocated chunk. We don't have to hold onto it to convince the GC that it needs to be less aggressive.

At least, that's my understanding.

Most of the memory footprint is unmanaged memory, which is largely textures, etc.

TechSY730

Nov 16, 2010 2:44 pm

reporter   ~0003734

Ah, art assets, a sworn enemy to RAM everywhere :P

Well, its good to know how all the RAM is being stored. I didn't know that large number of objects (not the art and music, just the objects) could take up so much space. Maybe that is why some hardcore real-time programmers shun object-oriented languages.

Chris_McElligottPark

Nov 16, 2010 3:00 pm

administrator   ~0003736

I wouldn't look on it as a failing of object-oriented languages. Rather, it's a testament to how ridiculously large the game is. There are literally hundreds of millions of object references shortly after starting up a game, and working sets of data on two threads, etc. I'm reasonably confident this is the largest real-time strategy simulation around, by several orders of magnitude. Even on the smaller ship caps and middling-sized maps. There's just nothing else remotely in this scale.

TechSY730

Nov 16, 2010 3:20 pm

reporter   ~0003738

Sorry, I was not trying to imply a failing of object oriented programming; I love the whole OO paradigm. I know AI war is an edge case; what other RTS can claim that having 10,000 units is normal for an small scale early game :D

Anyways, I'll stop here, as a bug tracker is not the place for casual discussion. :)

Chris_McElligottPark

Nov 16, 2010 3:25 pm

administrator   ~0003740

No worries, all good. :)

orzelek

Nov 16, 2010 6:16 pm

reporter   ~0003753

Last edited: Nov 16, 2010 6:17 pm

Heh 900MB is nothing worrying.. strange things start happen only when you near 2GB limit - usually apps crash before reaching it - around 1.7GB or so.

Issue History

Date Modified Username Field Change
Nov 16, 2010 2:36 pm TechSY730 New Issue
Nov 16, 2010 2:39 pm keith.lamothe Note Added: 0003733
Nov 16, 2010 2:40 pm keith.lamothe Status new => resolved
Nov 16, 2010 2:40 pm keith.lamothe Resolution open => fixed
Nov 16, 2010 2:40 pm keith.lamothe Assigned To => keith.lamothe
Nov 16, 2010 2:44 pm TechSY730 Note Added: 0003734
Nov 16, 2010 3:00 pm Chris_McElligottPark Note Added: 0003736
Nov 16, 2010 3:20 pm TechSY730 Note Added: 0003738
Nov 16, 2010 3:25 pm Chris_McElligottPark Note Added: 0003740
Nov 16, 2010 6:16 pm orzelek Note Added: 0003753
Nov 16, 2010 6:17 pm orzelek Note Edited: 0003753
Apr 14, 2014 9:28 am Chris_McElligottPark Category Gameplay - General Complaint => Gameplay Issue