views:

361

answers:

2

Hello SO,

Is the max limitation for malloc (virtual heap I guess?) for a 32-bit app on a 64-bit system (Windows 2003 SP2 x64, to be specific) 2GB?

I'm basically trying to push a program beyond that with no luck. So I was wondering if that holds true for ALL 32-bit apps on Win x64 bit platforms.

Thank you!

+6  A: 

You should link your application with /LARGEADDRESSAWARE to make more than 2GB available to the application. Then you can use up to 4GB on a 64-bit OS in a 32-bit application.

villintehaspam
+1  A: 

32-bit apps have a virtual address space allowing up to 4GB to be addressed on a 64-bit version of windows.

The 4-Gigabyte Tuning section in the Win32 and COM Development doc on MSDN, explains the /LARGEADDRESSAWARE linker switch. Switching it on will allow 32-bit apps to address up to 4GB of memory.

See the Memory Management section in the MSDN Library. Use of the WIN32 memory management services functions provides functionality that is not available in the C run-time library. Whether or not you need this functionality is up to you.

Robert