ARGH! CTD!!!!!
(7 votes, average 4.57 out of 5)
Written by AHWULF   
Wednesday, 24 November 2010 11:45

AHWULF addresses an issue that is affecting a few players that he and MARTINI are trying to solve: "This ctd bug has got to stop!It is inconceivable to me that with 9GB of RAM on Win7/64 and 1892MB on the nvidia card, I could hit out of memory absent a severe memory leak in the game itself given that nothing else was running other than Chrome."

 

AHWULF: Over the past 10 years the game has seen many upgrades in features. It has also grown in memory usage, partly because of the new features and partly due to the original design of the game which never anticipated so much new material.

Currently on the PC the client is experiencing a lot of this error:

C++ Exception: class std::runtime_error 'Out of memory' at address 758FB727

This is the primary cause of a large percentage of CTD's on the PC version.

The reason is that 32bit apps on Windows (any version) are limited to 2GB of virtual addresses, which translates into 1.7GB (more or less) of actual usable memory per process. When you hit the '2GB' limit (again at around 1.7GB) the OS tells the app 'sorry charlie no memory'. Right now the client uses a max of about 1.3GB of client data, and OpenGL further backs up all the textures in the application memory of around 400MB. Thus depending on what you do, what you are, what driver you have, etc. you may hit the limit a lot or just miss it.

There are alternate ways to get Windows to provide more memory for 32bit apps. One is PAE which allows more than 4GB of memory to be addressed, but drivers and applications may become unstable and the application is still stuck with 2GB; the other is the /3GB option which squeezes Windows into half of its normal 2GB space but also causes instabilities particularly with drivers.

Note also that the client does not have a memory leak that is causing the out of memory to occur, it is the result of living too close to the limit of memory.

The only proper solution is to slim the client down by about 150MB. There is no one easy fix to do this but we are identifying ways to not load everything up front, removing unused data, and even considering things like compressing parts of the data when not used.

The game has always tried to load as much up front as possible to avoid stutters later on. Now that we have reached the limit this will have to be pruned some. We can't do this kind of thing without being careful and testing the changes. Just think of it as pouring Slim Fast into the code. You can't lose weight all in one gulp. For example, today Martini made one change that removed 16MB of unused data.

Right now the easiest current solution is to turn on the 'Low Memory' option in preferences; at the expense of occasional stutters you won't use enough memory to ever hit the limit.

 

Add your comment

Your name:
Your email:
Comment (you may use HTML tags here):
  The word for verification. Lowercase letters only with no spaces.
Word verification:
Comments (10)
1 Wednesday, 24 November 2010 12:03
hchris
WOW I never even considered this, thanks for the excellent explanation. Nice to see it is being worked on.
2 Wednesday, 24 November 2010 23:30
Jacob
I use a mac, and don't have these problems :P.
3 Friday, 26 November 2010 07:12
Coolhnd1
It's strange you never mentioned the obvious solution of making the client 64 bit. I realize 64bit has issues as well but I would think this would be the best long term solution. Maybe even give people a choice of 64 or 32 bit client.
4 Monday, 29 November 2010 20:23
AHWULF
Making *this* client 64bit would require quite a rewrite. Not a real option.
5 Wednesday, 01 December 2010 04:52
drave
Why no 64 bit client? Doing some ugly hacks behind the scene? :)
6 Thursday, 02 December 2010 18:19
cjsporl
you guys should start building a 64 bit version of the game. This would remove this problem completly for those with a 64 bit version running a little more that 4gbs. You have improved the visuals of the game but the code is the same code since 2000.
7 Friday, 10 December 2010 10:46
Kanone
CRS has been avoiding rewriting the base code for years. But it's been sighted as the only way to add subs (among a myriad of other issues), and now here it could fix one of the game's oldest problems. What resources would CRS need for a rewrite?
8 Saturday, 11 December 2010 19:33
JWilly
Presumably if you install the game to an SSD, or you have enough system RAM to run a batch process that loads the game to a ramdrive and executes it there, you can run with the "Low Memory" option and still get minimal or no stuttering...?
9 Saturday, 11 December 2010 19:39
JWilly
Gophur recently commented that the "Low Memory" option is planned to be removed, because (IIRC) it causes a graphics glitch. Will there be another memory workaround?

Is there a plan to allow the client to grow past 1.7G, to allow more development?
10 Saturday, 18 December 2010 11:56
zeushammer
Generally happens more frequenly when I am in aircraft....