Memory usage

billw2015

King
Joined
Jun 22, 2015
Messages
837
A breakdown of allocations from the memory tracking code I added. I'm going to break it down by allocation location as well at some point, so we can see where all these ints are coming from!

Code:
-----------------------
Memory Usage Statistics
-----------------------

allocated type                                           blocks                 bytes 
--------------                                           ------                 ----- 
int                                                     2990661  69.6%       270.13 MB  50.6%
[unknown]                                                911573  21.2%       126.64 MB  23.7%
bool                                                      66140   1.5%        54.91 MB  10.3%
int *                                                      3946   0.1%        14.11 MB   2.6%
class CvBuildingInfo                                       6082   0.1%        12.95 MB   2.4%
class CvUnitAI                                             4824   0.1%         8.08 MB   1.5%
class CvUnitInfo                                           2075   0.0%         4.81 MB   0.9%
unsigned int                                              23232   0.5%         4.52 MB   0.8%
short                                                     67649   1.6%         4.34 MB   0.8%
class CvArtInfoUnit                                        5071   0.1%         3.04 MB   0.6%
class CvPromotionInfo                                      1266   0.0%         2.75 MB   0.5%
class CvArtInfoBuilding                                    5613   0.1%         2.38 MB   0.4%
class CvBuildingClassInfo                                  6073   0.1%         2.01 MB   0.4%
short *                                                    9956   0.2%         1.94 MB   0.4%
char                                                      65581   1.5%         1.84 MB   0.3%
class CvUnitCombatInfo                                     1073   0.0%         1.79 MB   0.3%
struct CvUpgradeCache::upgradePair                           18   0.0%         1.75 MB   0.3%
char *                                                     8365   0.2%         1.63 MB   0.3%
class CvReplayMessage                                     27484   0.6%         1.47 MB   0.3%
 
Yeah I definitely want to deal with these. My guess is 99.9% of the ints and bools are 0 and false respectively. In other words we are not doing our part in the fight against entropy.
Right now I am having some success with improving the paging system so it doesn't cause massive frame stutter when you pan around, which I think can be a big win. When it correctly evicts items from memory I can keep previously crashing saves from crashing even when panning the map for 5 minutes.
 
@Pit2015 now thanks to recent fixes of turn processing speed and memory management (paging fix) your map is much more playable in later eras too :D
I was panning a lot in advanced saves, and I didn't crash.
Balance on this map is other thing, as this map is 2x bigger than Gigantic size we have currently, and its easy to get 5 cities before Tribalism especially on eternity.

Billw said, that C2C code is worst ever he saw :lol:
Just like python was extremely inefficient when it came to pedia without PPIO.
 
Last edited:
I'm running my own gigantic map, marathon autoplay session now, with show all moves and show all combat enabled, and it managed to do 1500 turns over night without crashing. Will see what it's like when the whole map is full I guess! Would be useful to get copies of the advanced massive saves that people have so I can test against them.
 
Another Big :hatsoff:to billw2015!
 
I have 10 different saves, that are over 5 MB big, only one is bigger than 10 MB though.
They are on varying level of advancement, map size and AI count.
Handicap and game speed just means AI being this taxing slower or faster.
Link to saves - in total its over 60 MB.
 
Top Bottom