views:

201

answers:

2

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  A: 

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.

David Berger
+2  A: 

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.

Alonso