Is a 32-bit program running on a 64-bit OS able to use more than 4GB of memory if available?
-
It also depends on the machine/processor and the OS. – Romain Hippeau May 06 '11 at 21:06
-
possible duplicate of [Application cannot access more than 4 GB on 64 bit processor](http://superuser.com/questions/69480/application-cannot-access-more-than-4-gb-on-64-bit-processor) – OMG Ponies May 06 '11 at 21:11
-
This link may be useful: http://stackoverflow.com/questions/5916959/can-a-32-bit-program-use-more-than-4gb-of-memory-on-a-64-bit-os – Hasan May 18 '17 at 12:31
-
That links goes back to this thread... Anyway, the "only" limitation a 32-bit program has is that it cannot map more than 4GB ***at once***. But you can easily extend it through [shared memory](https://web.archive.org/web/20100103003357/http://blogs.msdn.com/oldnewthing/archive/2009/07/06/9818299.aspx). – mirh Jan 27 '20 at 22:33
3 Answers
Short answer is: yes. Longer answer is depends. There is a hardware support for page re-mapping, which basically gives your program a window of a few pages into a larger area of memory. This window is however, should be managed by the program itself and will not get support from memory manager. There are examples of programs doing that like SQL on Windows. However, in general it is a bad idea and the program should either limit itself for 4GB or move to 64bits :)
- 524
- 1
- 4
- 10
Normally you're limited to a 2GB address space, in which all your allocations and their overhead, fragmentation, etc., must fit along with memory-mapped files (which includes your program and the DLLs it uses). This effectively limits you to 1.5GB.
With special configuration, e.g. /3GB, you can make more than 2GB available to applications, but by doing so you rob the kernel of space, costing you file caching, handle capacity, etc..
On Win32, you can use more with PAE support, but it's not transparent, you have to manage it yourself.
- 22,897
- 2
- 80
- 94
Only by explicitly mapping 4GB ranges of memory into its address space.
- 868,454
- 176
- 1,908
- 1,964