whismerhill whismerhill

making Galciv2 access more than 2GB of memory with 32bit (no 64bit compiling and recoding necessary)

making Galciv2 access more than 2GB of memory with 32bit (no 64bit compiling and recoding necessary)

Large_Address_Aware bit info in galciv2 executables

I just had a few days ago, an out of memory error from galciv2 while quicksaving the game (4GB of ram + XP64) (sidenote: launching process explorer AFTER the crash showed me a peak memory usage of about 3GB with 1GB currently used by windows and other programs, so I think galciv2 just crossed the 2GB treshold)

while searching for other things for other games I stumbled on this information :

http://www.amd.com/us-en/assets/content_type/DownloadableAssets/Expand_Memory_of_32-bit_App_-_Microsoft_4GT-_6204.pdf

 

Apparently all you need to do is to set a simple "flag" or bit on the executable to allow it to access higher than 2GB addresses. And I of course already checked galciv2 executables and it is NOT set.

Q: Are there any other changes necessary to take advantage of 4GB virtual memory ?

A: No, only the LAA bit needs to be set with either a linker or binary change. no other source code or binary changes are required.

 

Of course I have the knowledge required to do this myself from my poor chair, but this is against the laws as far as I know. So just suggesting stardock devs to look into this, if they ever want so as this is ... like a 10 seconds modification, ok 5 minutes if you take the time to carefully read the document I linked to.

135,207 views 30 replies
Reply #26 Top

Thanks for the reply, whismerhill. I suppose that I'll just have to wait for Win7.

Reply #27 Top

double post

Reply #28 Top

Quoting whismerhill, reply 25
unfortunately XP home is a rather limited edition of XP 32 bits

and as such (AFAIK) it doesn't support the /3GB switch necessary for the OS to handle memory amounts up to 3GB for a single process

(in other words, if you modify galciv2 to access more than 2GB, XP home will ignore the setting and allow only up to 2GB

the documentation on this subject is rather sparse (and most people don't realize that the switch itself is not enough and so say proudly "it works" while it does nothing at all) though :

http://www.microsoft.com/whdc/system/platform/server/PAE/PAEmem.mspx (as one can see XP home is not written here.Media center edition too but XP media center is just an XP Pro with media center software)

ho and lastly putting it in your "boot.ini" file won't do any harm, it's just ignored..

 

 

for more general information there is interesting reads here : http://blogs.msdn.com/oldnewthing/archive/2005/06/01/423817.aspx

http://blogs.msdn.com/oldnewthing/archive/2004/08/05/208908.aspx

http://blogs.msdn.com/oldnewthing/archive/2006/08/14/699521.aspx

Wow, and I get called a nerd... ;P

Seriously, though; I bow before your prowess.

I tripped over this thread lookin for something completely different, but I had to ask:

I'm running XP x64 with 8GB RAM.  Would using this 3GB switch give any improvements in game performance across the board (assuming that it's possible with this OS).  (And also realizing that most games are coded for </= 2GB RAM).

Just curious.

Reply #29 Top

Afaik XP 64 is capable of a 3GB user space, so, if you do the modification, GC2 should be able to use more memory. I would not expect performance increases, it'll be mainly of use to prevent the game running out of memory when using the largest maps.

Reply #30 Top

ok this thread is freaking old but I never saw the last replies so I'll reply now because I don't like leaving potential false information in a thread of mine.

there is no need for any 3GB variables on X64 systems

If you read all the documentation you would understand why

 

a 32 bit system can only allocate up to 2GB to a single process. a 32 bit system with 3GB variables can only allocate up to 3GB to a single process. A 64 bit system can allocate much more than what would be relevant here.

 

a 32 bit piece of software (such as galciv2) can only get 2GB of memory. a 32bit piece of software with LAA can only get up to 4GB of memory. a 64bit piece of software (which is not the case of galciv2) can access much more than what would be relevant here. (don't wanna search back for the correct values) OF course game Engine limitations apply before that. Which means if a game is programmed to use only 500MB of memory, it could very well crash above it because it would simply not be designed to handle such a large amount.