I want to keep some applications to run with a 4 GB address space within a 64 bit OS running on a 64 bit processor (x86 xeon, 8 core). I know there is an option to compile with -m32 option, but at this moment the computer I’m working with, doesn’t have the required support for compiling with -m32, so I can’t use it, neither I can install anything on that computer as I don’t have any rights.
Now my question is if there is any possibility to restrict address space to 4 GB. Please don’t ask me why I want to do so, just tell me how if that is possible. Thanks.
The ulimit/setrlimit mechanism, accessible in bash via ulimit, can do this with minor drawbacks.
should limit the memory available to the current process group to 4 GB.
However, it limits the total size of your address space mappings, and does not limit your mappings’ offset
– you still may have pointers larger than 2^32.