Bypassing 2gb Memory / MAF Limit

bosstone

Chieftain
Joined
May 22, 2010
Messages
32
It's been well documented that without doing anything, Civ IV seems to create a Memory Allocation Fault north of 2gb in memory use.

Has anyone been able to allocate more than 2gb of memory is this a hard stop? I'm running C2C at 1.9gb of allocated memory (I have 12gb) and at any given time the program is on the verge of error-ing out.

If I missed an article (they are pretty dated) that are recent, please let me know. Win7 64bit in case that still matters.
 
Have you updated your C2C mod? Since a little time ago, strategyonly and his crew implemented a new system allowing better memory management, diminishing greatly the MAF problems.

There is the "3GB switch", but it did nothing on me...

Also, don't forget Civ4 is a 32 bits engine, thus limiting its capacity well below better machines can do by now.
 
My copy of C2C is only about a month or two old. Did you mean an update that is newer than that?

I did the 3gb switch too but it did nothing for me either. I believe a lot of the discussion in the past was about that, hence why I'm asking again. Sometimes the threads just need to be re-started to get a 2014+ answer.

I'm fairly certain that the 32bit limitation wouldn't affect memory too much, but I could be wrong there.
 
A month or two? Well, I think you have the new implementation already.
I have seen the 32bits architecture of Civ4 is a huge thwarter from many modders, especially those working on heavy mods.

Otherwise, I'm dried regarding solutions. I don't even play C2C because it doesn't even let me play a standard map in the very early turns...Let's hope someone more qualified appears. Or, try there. Since it's the official mod, there must be qualified people regarding that recurrent issue.

P.S. Never give orders or be impolite to strategyonly. He rages a lot.
 
Here is an answer from a modder of a heavy mod, but still smaller than C2C.
You were partially in the truth, but the play crawls immensely in the later stages.

32-bit Disclaimer

If you have a 32-bit OS, you will not be able to successfully finish a World Map game. 32-bit OS memory handling is such that after the savegame size exceeds certain size, the game starts to randomly crash from Memory Allocation Failure (MAF). There is no way to prevent this from happening sooner or later if you are playing World Map on a 32-bit OS. There is nothing we can do with this sad fact, as it is inherent in 32-bit architecture itself and the way Civ 4 engine works with it, and there is no fix for that available to a modder. Only play World Map if you have a 64-bit OS (or are content with playing roughly until Medieval era on a 32-bit OS)! Please restrict yourself to playing random maps if you have a 32-bit OS, and remember that the smaller the map size, the lower the probability of MAF.
 
My copy of C2C is only about a month or two old. Did you mean an update that is newer than that?

You may need to check the version number in-game (hover over your flag in the UI). If you got the game via Desura then you have a very old version, probably more than 10 versions old since Desura has never updated the version they install. If you did not get it that way then you are probably only 1 or 2 versions behind. Version 34 was released about a week ago. A relatively recent version, v33 from last September, added a new "graphics paging" system which should reduce memory usage by something like 30% compared to the version 32.

I did the 3gb switch too but it did nothing for me either. I believe a lot of the discussion in the past was about that, hence why I'm asking again. Sometimes the threads just need to be re-started to get a 2014+ answer.

I'm fairly certain that the 32bit limitation wouldn't affect memory too much, but I could be wrong there.

The 32-bit thing is the entire source of the memory problem. The best you can do is to run a 64-bit version of Windows which allows the program to use a full 4GB of memory (if you are using a 32-bit version of Windows it is pretty much useless to have more than 4GB installed in the computer).

Since you say you have a 64-bit version of Windows and 12GB of memory the rest of this is probably not relevant, but here you go anyway:

On a 32-bit version of Windows the program can never use more than 3GB, and only that much if you use the 3GB setting for the version of Windows you are running. Otherwise, using the default settings, the game can only use 2GB at most. If you use the "3GB" adjustment method for the wrong version of Windows it will do nothing useful. Even using the correct method may not be entirely helpful - I tried it a few times and it reduced the MAF issue but did not eliminate it, just delayed it, and it caused some other problems (although it was generally with other software - there was some stuff it couldn't load into the reduced system memory space that I occasionally needed). A 64-bit version of Windows does not have a "3GB" switch since it can already use way more than that (there are built in limits, but those are added in on purpose - I think the Home version of Windows 7 64-bit can use a maximum of 16 GB for the Premium level and "only" 8GB for the Basic level and the Pro version is much higher - something over 64GB but I am not sure exactly how much, although it doesn't matter since regular motherboards and chipsets don't support more than 32GB anyway).

On the other hand, there is a second memory problem: graphics card memory. If your graphics card does not have very much memory it can be a problem (it's a good idea to have at least 512MB for C2Cs recent versions). If your graphics card uses regular system memory, or you are using the on-chip graphics most recent CPUs have which do so, then you might not have the graphics memory problem but might (if you don't have enough actual memory for both) make the regular 32-bit related problem with the memory worse since it is allocating some of the memory to use it for the graphics.
 
I'm fairly certain that the 32bit limitation wouldn't affect memory too much, but I could be wrong there.

Yes you would be. On a 32 bit system, the most you can get the game to use is 3 gig by implementing the 3 gig switch. Since Beyond the Sword is already Large Memory Address Aware that only involves adding the switch to your boot routine, you need to do nothing to the program itself. On a 64 bit OS, you don't need to bother with anything, the game will automatically use more RAM if it needs it. However a 32 bit program can't use anything more than 4 gig of RAM even in that kind of environment. That's the maximum limit as to how much RAM that particular architecture can make use of.
 
So, is there any definitive fix for the MAF error on Win7-64 bit machines?

I'm running an i7 rig with 12GB of memory and a 1GB video card and I'm getting MAF's every 2-4 turns. I'm playing BtS 3.19 with C2C v35.
 
Top Bottom