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.
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.
In x64 Windows, that should be all you need to do.
In x32 Windows, you also need to use the /3GB switch in Boot.ini. And you might also need to use the /Userva switch to fine tune the memory usage, especially if your video card has a lot of ram.
I'm not sure what you implied but a 32bit application(like galciv2) without LAA bits is limited to 2GB of addressable memory (all included)
whatever the microsoft OS is ...
but true though that for LAA to work you either need:
-a 64bit OS
-windows vista 32bit with "bcdedit /set IncreaseUserVA 3072"
-windows xp 32bit with /3GB switch ni bootini
BUT even if a user doesn't meet the requirements for LAA to be useful, it doesn't hurt at all.
Keep in mind that there's a reason this flag is not enabled by default. The game may crash if you enable this. It depends on how sloppily it's coded. (Technically, it should work without any problems, but programmers often end up making assumptions about the system based on what *seems* to work. And if they assume anywhere that memory pointers stay below the 2gb point, all sorts of fun bugs can appear once you enable LAA.
So it's very possible that won't enable the LAA flag. It'd require a hell of a lot more testing (and possibly bug-fixing) on their part, which might be hard to justify this late in the game's lifecycle.
However, I can't see any reason why it shouldn't be legal for you to enable it yourself, although of course editing the .exe will probably cause the Impulse patcher/version checker to flip out.
Also, as said above, this only has an effect on 32-bit systems if you also use the /3GB switch (which, again, may cause instability in your drivers for the same reason. Most drivers aren't tested with that switch, because it's not commonly used.
So I'd recommend only doing this on a 64-bit system. (/LAA will then allow the app to use up to 4GB memory)
hum well yeah it seems pointers need to be 32bit for it to work according to AMD document. I'm not a programming guru but it seems 32bit pointers are already required for 2GB ranges which would make it a non-issue ? (that's a question)
On the legal side, I think it's forbidden to alter an executable which don't belong to yourself at least in france, and you just have to rename the modified exe to not freak out impulse/SDC.
Just keep a copy of the original exe in a different location, and swap it back if you are checking for updates.
And I don't know about DA or Twilight, but enabling the flag in DL works just fine. I have not changed it since I reinstalled my system a couple months ago, but I had modded the exe and had been running it for about a year and a half with no problems.
well since it seems nobody cares at stardock about this (or at least they didn't voice it)
I'll point to a thread explaining the procedure for civilization 4 (same thing just different executable)
http://forums.civfanatics.com/showthread.php?t=224178
moderators/admins: feel free to delete or ask me to delete if I'm going too far
The devs don't read every post.
Emailing support@stardock.com should get it to them.
since I don't really require any support I find it rather weird to email support about it
thanks for the suggestion though
I'm a little confused. The title of your post says that you are using 32bit, but the body of your reply implies that you are using 64bit.
If you are using XP, then only the PRO version will allow you to address 3gig, and you can do this at 32 bit.
I'm not talking of the same thing for both values :
-in the title, I talk about galciv2 executables which are currently 32bit (and I note that 64 bit recompiling is NOT necessary)
-in my post I note that I have XP64 myself but this suggestion ain't really centered on myself
on XP32 both the pro and media center editions allow to use the 3GB switch
It might disqualify you from the MetaVerse, but I don't know what law it is breaking.
in france there's a law against reverse-engineering, that's also the reason why "cracks", so to speak, are not legal
well i don't care i just can't save my game could some one help...
Freeman43, perhaps you should start a new thread about your problem.
And include more detail about what you were doing, how long you were in the game when the problem happened, and the entire text of the debug.err file for your particular game just after it crashed.
Many programs use signed computations to calculate memory ranges:
I.e.:
function pointer_distance(p,q:pointer):integer;
begin
pointer_distance:=integer(q)-integer(p);
end;
This code would return a negative number in case p=pointer($7fffffff) and q=pointer($80000001)! The program may then try to copy a negative number of bytes or so. In order to make a program work with 3GB address space, all pointer computations need to be done using unsigned arithmetic. That is why a special bit is necessary before a program gets more than 2GB of address space.
IMO altering a program is legal, as long as you do not redistrubute it. The EU software directive explicitely allows you to modify a program to make it interoperable to your hardware.
And include more detail about what you were doing, how long you were in the game when the problem happened, and the entire text of the debug.err file for your particular game justafter it crashed.
i did!
why do you even post that here is beyond my comprehension...
this thread is about enabling more than 2GB of memory for galciv2, if you want to do it, read this thread to understand all the prerequisites & such ... then read on civfanatics thread (which is linked in one post here already) and you'll see how to do it. (I won't relink it on purpose since one should understand what he is doing and so read this thread before)
if this seems too complicated for you or if you don't meet some hardware/software requirements, then I suggest you move on to another thread to continue with solving your issue.
ho ok thanks for the explanation, I'm not used to working with pointers, well it seems to work either way but maybe I just got lucky
And I didn't know that the "EU software directive explicitely allows to modify a program to make it interoperable to your hardware"
Seems like if it's really applicable in france then it's a hole against those new laws that forbid going against integrated anti-piracy DRMs
Somehow I still doubt it would hold in court in France, more so with our "new" president...
Depends. The software directive only allows modifying binaries to make them work on your hardware. If you remove a protection, forbidden under the copyright directive, this is only allowed if removing the protection is necessary to make the program interoperable with your machine (i.e. in case the copy protection is not compatible with your CDROM drive or so). Even then, the copyright directive remains in full force, I cannot tell werther the software directive would get precedence over the copyright directive in such a situation.
It is very likely a modification would appear to function correctly, because a pointer subtraction (or a comparison of pointers) over the signed/unsigned boundary is extremely rare and can only occur if the program actually uses more than 2GB of memory. However, cannot be ruled out it happens. That means a piece of software could randomly crash on such an OS, which is why Microsoft has chosen an opt-in.
Linux on the other hand, does not offer an opt-in because the 3GB/1GB split is so terribly old that there exist no backwards compat issues. so if you code for Linux you'd better do your pointer calculations unsigned. The compiler warns to help.
@whismerhill - OK, you officially rock! I've been needing something like this for a while. I might be able to salvage an old game that I had to end early due to OOM errors.
Thanks!
well in fact, as I see it, it can't hurt at all in this case
why ? let's say for the sake of an example that game ZETA got modified with the LAA flag
case 1 : the game ZETA never goes beyond 2GB => this modification while completely uneeded won't hurt the well being of the game
case 2 : the game ZETA crosses 2GB and don't have any checks with signed boundary => ok all is fine, and we did well to allow the game to use more than 2GB or else the game would have crashed.
case 3 : the game ZETA crosses 2GB and have a check with signed boundary at some points => once the game is beyond 2GB, it can crash at any moment BUT if the game did not have the LAA flag it would have crashed anyway ...
so as I see it, the worst you can have is that this modification won't improve anything, that is either you crash because you got Out Of Memory
or you crash because the game checked a signed boundary ...
between a crash or a crash, I chose a crash
Joking aside, maybe one type of crash could be preferable over another like maybe one certain type could crash the whole computer rather than just the app.
Hi Whismerhill et al:
Does this apply to any (home) versions of XP, or is it only for pro/media? Reading through the pdf seems to imply any version, but I would like to be sure.
IF this does apply to 'home', can someone walk me through the procedure? I have always been quite computer savvy, but for some reason this particular procedure sticks in my cranial craw. I don't know why, but it does.
Thanks in advance.
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
There are many great features available to you once you register, including:
Sign in or Create Account