Game keeps crashing!

Well, it looks like this the /3GB switch with /Userva finally did it. Thanks so much. What I don't understand is why a program that appears to use under 1GB of ram, requires a cap higher than 2GB. But I suppose that's one reason why I'm not a 733t coder somewhere... :)
 
Well the best thing is I learnt something that is more generally useful. :)

Although I think I know why I was having problems even though the executable was only showing the use of 800MB of ram. I expect that the cap is on total memory usage usage, and the task manager only shows the usage of physical ram. The same kind of thing happens when you look at the memory cap for 32 bit processors.

The cap is 4GB but the Windows information only shows I have 3.25GB of my 4GB. The thing is that cap is on total memory, which includes video ram, and all the various caches as well.
 
I just thought I'd add a post script. ori's help was pure gold. All the crashes are entirely gone. I don't believe I've had one crash since I got the configuration right. :)
 
Sorry for butting in on a finished thread, but how do you change the amount of memory that Windows allows a program to use?... I have crash problems too, when the game is very complicated towards the end, and I think that changing the settings to 3G might help... but I have no clue how, I'm a complete computer moron.
 
It's quite simple with Windows XP, but I'm guessing that this tweak is only useful if you have 4GB of ram installed on your computer.

- open My Computer or Windows Explorer
- navigate to the root of the hard drive that has Windows on it (typically your "C" drive, and by "root" I mean the first level), you may get a warning when you do this, ignore it
- At the top menu bar on the window click on "Tools" then choose "Folder Options" from the drop down menu
- Click on the "View" tab and make sure that "Show hidden files and folders" is selected, and "Hide extensions for known file types" is not. Click on "OK" to close the menu.
- Now on the first level of the drive that has Windows on it you should see a file called "boot.ini".
- Right click on the "boot.ini" file, choose "Properties", make sure that the "Read-only" box is unchecked. Click on "OK" to close the menu.
- Now open the "boot.ini" file with a text editor, such as Notepad (although that is a terrible text editor, but we won't go into that here, for this it will do :) ).
- Look for the line that starts something like this: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="[your Windows version]"
- At the end of that line add the following: /3GB /Userva=2600
- Save the file and close it, make sure you open the properties of the file and recheck the "Read-only" option, and reboot your computer.

If all goes well you will have no problems. The "/Userva=x" option can have any number between 2100 and 2900 in it. Basically you want it to be as high as possible without it causing any problems. You might want to start with 2800 and lower it to 2600 if there are problems. You can also completely remove the "/Userva" switch, which would give you a cap of 3GB. However, in my experience, this can cause system instability. The kinds of problems you may notice are programs that start when you boot your computer behaving strangely, or crashing.
 
one nitpick: the userva value has a max of 3030 - which would be the same as not using it - anything lower will reduce the max amount of memory from 3GB (3030 MB)...

Yes, you are correct. I've edited my post. Just thought I'd add that due to an issue I experienced with FRAPS I reduced the number to 2400. It still seems to do the trick nicely. We'll see how it goes though later in the game. I may have to adjust it again.
 
OK, that seems very simple. Thanks a million.

Just one question before I change the setting... when you say
system instability' what do you mean by that?
 
Just one question before I change the setting... when you say
system instability' what do you mean by that?
The kinds of problems you may notice are programs that start when you boot your computer behaving strangely, or crashing.

I reduced the number this last time because FRAPS wasn't showing fps numbers. None of it was anything horrible, for example my system didn't just lock up. One thing I should say is that how high you can set the number will depend on how much video ram you have, and how many peripherals you have.

A good rule of thumb is to look at the ram that Windows says you have when you right click on "My Computer" and choose properties. Assuming that you have 4GB of ram installed you want the "/Userva" switch number to be roughly 750MB less than the amount of ram the information in My Computer is showing. So if it is showing 3.25GB, as it is with me, 2400 appears to be a good number, although it wouldn't surprise me if I could up that to 2500 if I needed to.
 
Hmmm, a post seems to have been deleted. Well, I might as well take the opportunity to put the finish on my contribution to this thread...

Just thought I'd add to this to explain some issues I've had, and how I've fixed them.

Not long before I started using this memory tweak, I had started using Mz CPU Accelerator to manage the priorities of my running apps. You can also use the app to assign processor affinity for programs, but in my experience that degraded performance and caused some stability issues.

I had put my mouse and keyboard software on realtime priority and my active Window apps on high priority, but found that while it seem to improve performance in game it actually caused issues with input lag in my chat client and browser. So I have reduced my mouse and keyboards software process priority to high, and disabled the ATI Hotkey Polling service, which in my opinion should have been uninstalled when I removed the Catalyst Control Center software - but more on that to come. This seems to have fixed the input lag problems and improved performance significantly.

I put many other processes that didn't require high priority on low and lowest priority. I had raised chat from lowest to low priority and between that and switching the priority of active window appications and the keyboard and mouse software. I'm not sure I have completely cured the keyboard input lag issue in Firefox and the Miranda chat client, but time will tell. For now it is behaving itself.

I was also experiencing some odd behaviour in terms of my display, for example at one point after a game with a program size over 2GB I was unable to change screen resolutions. I uninstalled the ATI Catalyst Control Center, seeing as it was redundant, I use ATI Tray Tools which provides all the same functionality, and much more, but is much cleaner and less bloated. Just make sure you use the latest beta for ATT, which you can download from the forums, as the latest release version is very much out of date.

I then found a simple method for cleaning ram (yes I got this from one of those evil blogs ;) ). It is actually involves running the same utility to perform memory maintenance that Win XP will use periodically.

What I find funny is that someone who has taken one of those Microsoft certification courses submitted comments to the effect that XP's memory management is phenomenal and using this functionality actually made things worse. Which of course begs the question, if it makes things worse, and XP's memory management is so perfect, why does XP make use of this functionality on it's own once every three days? This poster also claims that this process can take up to fifteen minutes. I have never had it take more than a few seconds to complete.

To make a long story a bit longer, I now use this method to clean my ram every time after I run a program that requires a very large amount of ram, and I am no longer experiencing any of the minor issues I was before, which would require a reboot to fix. Now whether the improvements are a result of using this method, or whether they are a result of the other changes I have made, I can't be sure, but I do know it isn't causing any problems.

I should add that in most cases you should be extremely wary of apps that claim to optimize memory. At best they tend to be useless, and they are often used as a vehicle for adware and other forms of malware. What is different about this particular method is that it uses functionality included with Windows XP. It simply gives you control over that functionality, which of course is something we know that Microsoft generally finds distasteful... ;)

I have finally settled on a program size cap of 2.5GB. This leaves 750GB for Windows to work with, and that seems to be a good number. I should also add that I am able to run huge map games of Fall Further, with 46 leaders in the game, with very few issues, although I have yet to get to a very late game scenario with one of these where the demands on memory would be at their peak.
 
I raised it the userva number up to 2800, but experienced some issues, so I've put it back to 2560.
 
Just thought I'd add what I've learnt recently. Note that this is with Windows XP. I don't expect to have the same issues when I switch to Windows 7, which will hopefully be sometime this year.

If you have 4GB of ram and 512MB of video ram, the magic number for the /usrerva switch appears to be 2816. If you have 1GB of video ram, the magic number appears to be 2560.

One thing that I did that seems to have enhanced stability significantly is using the Mz CPU Accelerator to set the affinity for the Civ4BeyondSword.exe process to CPU1. I learnt this playing Ultima Online with their enhanced client which unfortunately uses the same 3D engine that Civ4 does. I have had very few, if any, crashes since I started doing this.
 
Back
Top Bottom