1

I strongly expect this to end up as a duplication, but I can't seem to find it.

I've got a C++ program that I normally run on 64-bit MacOSX SnowLeopard.

When I try to run it on a 32-bit Windows 7, it runs out of memory. Probably, it really needs too much memory, but I want to make sure that I'm not missing some sort of option or another that allows me to squeeze out the maximum possible heap size.

1
  • Oh, dear, I carried a corrupt data file to Windows. How embarassing. With that file, memory usage on MacOSX hits 3G and keeps going. – bmargulies Jan 18 '10 at 22:55
1

According to this table, the limit per process should be 2GB or 3GB with some registry tampering. I don't think this is much different from previous versions of Windows. I recall XP limited addressable memory to 3GB.

2

32 bit Process have a 4GB memory limit, but it's spitted into 2GB for the user address space and the kernel address space.

There is a /3GB switch so that you can use 3GB for the user space and 1 GB for the kernel space. To do this you need to change a setting in the OS through boot.ini(Win 2000, XP, 2003) or the bcdedit utility(Win Vista an later). Also you need to make your exe aware of this switch linking it with the /LARGEADDRESSAWARE flag. You can do this with the editbin utility(it comes with the Windows SDK).

Other than that I'm afraid you have to make some changes to how your app runs so that it doesn't take as much memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.