How to use more than 3 GB in a process on a 32-bit Linux application with PAE support?

PAE ( Physical Address Extension ) was introduced in the CPU back in 1994. This allows a 32-bit processor to access 64 GB of memory instead of 4 GB. Linux kernels offer support for this, starting with 2.3.23. Suppose I download one of these kernels and want to write a C application that will have access to more than 3 GB of memory (why 3 GB? See This ).

How do I access more than 3 GB of memory? Of course, I could refuse several processes; everyone will get access to 3 GB and will be able to communicate with each other. But this is not a realistic solution for most use cases. What other options are available?

Obviously, the best solution in most cases would be to simply boot in 64-bit mode, but my question is how to use physical memory above 4 GB in an application running on a 32-bit panel with support for the PAE kernel.

+3
source share
6 answers

You don’t, directly - while you are working on a 32-bit basis, each process will obey the branching of the VM in which the kernel was built (2 GB, 3 GB or if you have a fixed kernel with a 4 GB / 4 GB connector, 4 GB).

- shmfs, fs, // mmap ( ). , , 3 .

+9

memcached, . memcached 3GiB 32- .

API memcached. , 64- . . 64 , memcached , .

, , , Windows, , memcached.

+6

Unix 32- mmap/munmap, / , . . () ( ).

mmap - , , , 128 , . -64 , 64- , , ;)

PAE .

+3

PAE . , 32 , 4G . , , 2G (windows) 3G (linux) , 64- .

+3

, a > 4G , .

, mmap ; mmap, ( ).

, . ? , ?

+2

, 64- , , 4 , 32- PAE .

You don’t have to do anything special. Only the kernel needs to access physical memory, and with PAE, it knows how to access physical memory above 4 GB. The application will use memory above 4 GB automatically and without problems.

0
source

Source: https://habr.com/ru/post/1722474/


All Articles