Game hitting 2GB memory address limit and crashing

http://forums.gaspowered.com/viewtopic.php?t=2382

Playing with all the graphic settings on high and a large map with a good amount of ships is causing the game to hit the 2GB virtual addressable application space limit.

I had suspected this was the cause of my game crashing, and after seeing the game using 1.75gb of RAM in task manager I figured it was probably trying to address more than 2gb and crashed. So i changed the .exe to allow >2gb address space, and crashes stopped!

This is a problem in other games, such as Supreme Commander, and there is a fix out there. Ideally you want a 64bit OS but 32bit can also work around it.

What I did for the fix was use the Supreme Commander fix applied to Sins. There is a program that will fix your .exe file to allow more than 2gb of address space, then you just either need a 64bit OS or an edit for your 32bit OS. Ill post the link for the information, what I did was just rename my Sins of a Solar Empire.exe to SupremeCommander.exe, run the fix, then rename it back to the original.

Head over to the Supreme Commander forum and check this post out.


http://forums.gaspowered.com/viewtopic.php?t=2382

20,040 views 18 replies
Reply #1 Top

Yep that makes sense but I never herd of that until fix until now. I had sins running exactly the wasy you had on 32bit vista. It crashed when it hits about 1.85 gb when my virus scan software turns on, but it sometimes it just crashes on high memorey usage, I had only 2gb of ram at that time but my simple fix was upgrading ram so I spent $60 bucks on 4gb of ram, it was the cheapest and best deal. Now my computer can run on about 3.6gb of ram, and sins is fine on max and on huge maps 300+ planets, and lots ships quite fine. I'm hoping to upgrade to 64bit vista to use 6gb of ram.

Reply #2 Top

Question for IC: How much work would it be to provide a 64-bit executable for those of us that can provide it more ram? I know that sometimes it's simply a compile with a different set of flags and other times it involves significant rework.

Reply #3 Top

It could be done but it would screw up the determinism required for multiplayer. The issue has been coming up more often now because of the additional textures and the unbalanced use of mines. Once we have mines rebalanced and more texture optimization (we didn't do much optimization for the beta) it shouldn't hit the the barrier in normal play unless people are using a crazy mod. 

Reply #4 Top

Quoting DarthCaedusMorgan, reply 1
Now my computer can run on about 3.6gb of ram, and sins is fine on max and on huge maps 300+ planets, and lots ships quite fine. I'm hoping to upgrade to 64bit vista to use 6gb of ram.
End of DarthCaedusMorgan's quote

 

If you wish, you can have the full 4gb... WinXP 32 from service pack 2 and vista 32 can use a PAE kernel... it is possible for all processor from the pentium pro, they have the 36 bits support ( good for 64 GB ram )... using the /PAE in your boot.ini will allow you to put the address range of the material over the 4 gb limit...

 

Once you have the full 4 gb, it is not yet perfect... Application use 2 gb and kernel 2 gb... kernel don't need so much ram unless you run a mail server by example... so, by adding the /3gb in your boot.ini, you allow 3gb for application...

 

XP x64 and vista x64 will not change a lot...for 32 bits application, they use Wow64. The WoW64 subsystem is a lightweight translation layer that has similar interfaces on all 64-bit versions of Windows. Its primary purpose is to create a 32-bit environment that provides the interfaces required to allow 32-bit Windows applications to run unmodified in the 64-bit system. Meaning that you will have maximum 4 gb by application...

Reply #5 Top

it shouldn't hit the the barrier in normal play unless people are using a crazy mod.
End of quote

 

Thank to call 7DS a crazy mod... the barrier is not related to the system... using linux and sins, i can use fully my 16 gb ram... some game have go over the 10 gb... the barrier is the limit on the number of mesh and texture that YOU have put in the engine...

 

For info, we are in 2009... when the game was out in 2008, the only computer's find at my usual food market was already all with 64 bits processor... First 64 bit processor was made in 1961 but for the x86 desktop familly, it have begin in 2003... it is nothing new...6 year in computer evolution is like prehistoric time...

 

But in some way, i am happy that you have no 64 bits version... all know OS compilers today use the LP64 model (including Solaris, AIX, HP, Linux, Mac OS X, FreeBSD, and IBM z/OS native compilers). Only Microsoft's VC++ compiler uses the LLP64 model. These last create a overflow error when a pointer is assign to a long register... because microsoft is the only one who have keep the long register to 32 bits in place of 64 bits like other...

 

Sure, you have made me mad... your comment is like a insult for modder who try to find solution for go around YOUR OWN BARRIER...

 

For info, the well know texture memory leak from Sins is partially resolved on Linux system... This problem exist from day one... the last version 1.12 don't yet resolve it... don't you think that a solution to the old problem will resolve some of the memory problem...

Reply #6 Top

Quoting jjandrah, reply 2
Question for IC: How much work would it be to provide a 64-bit executable for those of us that can provide it more ram?
End of jjandrah's quote

Quoting Blair, reply 3
It could be done but it would screw up the determinism required for multiplayer. The issue has been coming up more often now because of the additional textures and the unbalanced use of mines. Once we have mines rebalanced and more texture optimization (we didn't do much optimization for the beta) it shouldn't hit the the barrier in normal play unless people are using a crazy mod. 
End of Blair's quote

How about, as the OP linked to, making the executable Large Address Enabled, nullifying the need for multiple executables?  At least it would allow the game to use up to 4GB whilst extending the scope of modifications.

Reply #7 Top

use

http://www.ntcore.com/exsuite.php

  1. Open CFF Explorer and then open your SC2 .exe file.
  2. Go to the "File Header" section (under Nt Headers) and click the "Click here" on the Characteristics row.
  3. Check the "App can handle >2gb addressest" box, then click OK
  4. Go to "Save as", and then rename your existing SC2.exe (for backup)
  5. Save the current version as SC2.exe, and voila, the game now won't crash when it's memory space gets too big (you still might want to restart occasionally if you have 4GB of ram or SC2 will push all your other programs out of memory)

helped me with sc2

great way to fix games

Reply #8 Top

Way to necropost a 22 month dead thread....

You're referring to Large Address Aware and I can assure you that you're mistaken in how it's helping you.  It does not fix 32bit games running into memory issues because of a whole host of other reasons, software, hardware, and system related that you don't even bother to mention.  Only a 64bit executable can do that.

Reply #10 Top

Quoting Thoumsin, reply 5

it shouldn't hit the the barrier in normal play unless people are using a crazy mod.

 

Thank to call 7DS a crazy mod... the barrier is not related to the system... using linux and sins, i can use fully my 16 gb ram... some game have go over the 10 gb... the barrier is the limit on the number of mesh and texture that YOU have put in the engine...

 

For info, we are in 2009... when the game was out in 2008, the only computer's find at my usual food market was already all with 64 bits processor... First 64 bit processor was made in 1961 but for the x86 desktop familly, it have begin in 2003... it is nothing new...6 year in computer evolution is like prehistoric time...

 

But in some way, i am happy that you have no 64 bits version... all know OS compilers today use the LP64 model (including Solaris, AIX, HP, Linux, Mac OS X, FreeBSD, and IBM z/OS native compilers). Only Microsoft's VC++ compiler uses the LLP64 model. These last create a overflow error when a pointer is assign to a long register... because microsoft is the only one who have keep the long register to 32 bits in place of 64 bits like other...

 

Sure, you have made me mad... your comment is like a insult for modder who try to find solution for go around YOUR OWN BARRIER...

 

For info, the well know texture memory leak from Sins is partially resolved on Linux system... This problem exist from day one... the last version 1.12 don't yet resolve it... don't you think that a solution to the old problem will resolve some of the memory problem...
End of Thoumsin's quote

 

Just because you can afford a 16gb system, doesn't mean the rest of us can.

Reply #11 Top

just because sins is a 32bit game does mean i can afford to be cheap. ;P

Reply #12 Top

Quoting ice27828, reply 10
Just because you can afford a 16gb system, doesn't mean the rest of us can.
End of ice27828's quote

Wowww, more that 3 years for reply to one of my post...

For info, at the time, i was what is called a working poor... and now, i am simply without work using the same computer...

A lot of people make the mistake to think that buy expensive thing is a sign that you have plenty of money... sure, before these computer, i was buying cheap computer who was outclassed after a few month... it was cheap in the short term but in the long term, it was very expensive... if a poor guy wish to survive in the long term without fail in the credit trap, the only solution is to buy quality...

As for my computer, i have choice quality... have cost me around 5k but if i have not setup it myself, it will have cost me 15k... included in the setup was a 800 buck graphic card and a 900 buck all in one color laser printer... sure, 900 for a color printer is a lot when you think that you have color inkjet all in one for less that 100$... but again, it is a long term choice... i have print several book, more that needed for fill a big book case and i have not yet need to replace one single cartridge...

These computer was 1/3 of my yearly income and i have no regret at all... now, a half decade after the purchase, it remain a top computer when compared to recent desktop computer...

As for RAM, my Kingston ValueRAM KVR800D2D8F5K2/2G have a little impact on the total price... at 43$ each, for 16 gb, it cost less that the last 3D software that i have purchase... for move from my old xp pro to win7 pro ( lower verion who support 2 processor ), it will cost me 448 euro, the equivalent of almost 21gb ram for my computer...

And my ram are expensive FB-DIMM DDR2...actual desktop computer use cheaper DD3, you can have a Corsair Vengeance CMZ16GX3M4A1600C9 ( 16 gb kit ) for less that 80 euro... less that i have already spend for the sins game ( over 100$ and i have not yet pre-order rebellion )...

Believe me, i am a greedy guy without a lot of money... i think two time before spend a nickel... and i always need to think long term because i refuse to use any credit thing... i am poor but i have no debt... what i have is mine and not owned by the bank...

Reply #13 Top

Moderators, please lock this thread.  It is out of date.

Reply #14 Top

So, not to jump on the necro thread bandwagon or anything, but... did the developers ever provide a reason why they can't just ship the game with the LAA flag on? Most people who are serious about large maps or mods are going to enable it anyway, but a certain minority are either unaware of the problem (or how to fix it) or deem themselves too technically inept to even try.

64-bit is more of a pipe dream right now (maybe for Sins 2), but LAA is not that unreasonable. Hell, Bethesda enabled LAA by default in Skyrim after thousands of complaints. Do we need to create a petition?  X|

Reply #15 Top

Possibly because that's only a band-aid on the actual problem that would split the community in two.

Reply #16 Top

Quoting RonLugge, reply 15
Possibly because that's only a band-aid on the actual problem that would split the community in two.
End of RonLugge's quote

I think that you are right... modify the .exe for set LAA in the header change the checksum of the .exe ... very possible that online game is not anymore possible... and for the 64 bits, desync between a 64 bits and 32 bits version is the reason...

If they move on 64 bit for sins 2, it will not be a problem anymore... as for skyrim, need to remember that it is a single player ONLY game...

Reply #17 Top

Quoting RonLugge, reply 15
Possibly because that's only a band-aid on the actual problem that would split the community in two.
End of RonLugge's quote

Uh? How would it split the community in two if the official version of the binary comes with LAA Enabled?

Your logic doesn't make sense. You seem to be suggesting that only half the people would receive or use the version with LAA enabled. I don't understand how that's possible, if everyone is downloading the patch from the patch server. It would be like every other patch: upgrade, or get left behind with a few hold-outs who don't like the new version. Rebellion, itself, is going to be infinitely more divisive to the community than any bit-twiddling could ever be, because a lot of people are saying they don't want to pay all that money for an expansion, and some people just don't like Titans period. So you're going to have some people playing Original Sins, some people playing Entrenchment, some people playing Trinity, and some people playing Rebellion. Is that divisive enough for you?

And for systems that don't actually take full advantage of LAA (for example, 32-bit systems that don't have the 3GB switch on), there would still not be a problem, because the binary would be bitwise-identical to the binaries that 64-bit users use. It's still a 32-bit binary with the LAA switch enabled, regardless of whether or not the system is taking advantage of it. Those people would just be more prone to crashing, which -- gee -- is exactly where we are today.

The difference would be that, as it stands today, everyone crashes when we exceed the 2GB limit, unless you set up a custom game where all the players have the LAA switch enabled. If you enable it by default, then only the people who are too incompetent to enable a switch in boot.ini would crash (and if you're on any 64-bit OS, you don't even have to enable any switches). So considering that quite a lot of people either (a) have a 64-bit OS, or (b) have enabled the 3GB switch, we'd go from minidumping like crazy, to only occasionally one or another person minidumps because they can't type a few characters into a plain text file in the C:\ directory.

As for the checksum issue; that's ridiculous. It's totally feasible to add in code to certify more than one version of the architecture-specific files. If a 64-bit version of Sins is just waiting on this one tiny thing, I'll volunteer to hack together the code in C++ or Lua or whatever Sins uses, and I'll even sign an NDA license and do it for free without taking up hardly any developer time from Ironclad.

The issue to me seems indefensible. It's just laziness or apathy that is keeping the default Sins shipping as 32-bit only and without the LAA flag enabled. There's no good technical reason not to, at least, flip the damn switch. 64-bit I could understand might be a little more challenging if some of the code as designed is not 64-bit clean; but I haven't gotten the indication from the developers that this is the case.

Reply #18 Top

Quoting Allquixotic, reply 17

Quoting RonLugge, reply 15Possibly because that's only a band-aid on the actual problem that would split the community in two.

Uh? How would it split the community in two if the official version of the binary comes with LAA Enabled?

Your logic doesn't make sense. FLAME.
End of Allquixotic's quote

Create a 64-bit executable for SOASE Trinity.  Show how easy it is to do.  SOASE II: Space Pwnyage will be 128-bit OS and out in 2020.  Sadly, most computers by then will be 384-bit systems and you'll bitch about SOASE II: Space Pwnyage for being behind the times.