Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a 32-bit program use more than 4GB of memory on a 64-bit OS?

Is a 32-bit program running on a 64-bit OS able to use more than 4GB of memory if available?

like image 710
krisostofa Avatar asked May 06 '11 21:05

krisostofa


People also ask

Can 32-bit OS support more than 4GB of RAM?

32-bit operating systems cannot address more than 4GB of RAM unless they have a feature like “Physical Address Extension” in Windows that allows the system to address a larger amount of RAM. A 32-bit OS without such a kludge will support 4GB at a maximum.

What is the difference between 32 bit and 64 bit operating systems?

Also the actual OS might consume more memory on a 64 bit setup, however one drawback of 32-bit system is that your entire system memory size is limited to 4GB (or practically about 3.5 GB due to some memory space being mapped to hardware). Show activity on this post.

How much virtual memory does a 32-bit operating system have?

On x86 systems, all applications are given 2GB of virtual memory out of the maximum 4GB available for the 32-bit architecture: the other 2 GB are reserved for the operating system itself. On x64 systems these additional 2 GB can be accessed by any 32bit application, as long as a specific flag is set in the file’s internal format.

How much RAM does a 32-bit x86 processor have?

Top tier 32 bit x86 processors have Physical Address Extension, allowing them to be wired to up to 64GB of memory. Memory segments can point to arbitrary slices of up to 4GB of the whole Is it true that a 32-bit app can only access 4 GB of RAM total? No. It just means its single memory segment size is limited to 4GB at a time. Which in turn means:


2 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 :)

like image 94
Philip Derbeko Avatar answered Oct 19 '22 09:10

Philip Derbeko


Normally uou'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.

like image 41
Tim Sylvester Avatar answered Oct 19 '22 09:10

Tim Sylvester