Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- How Do You Allocate Ring-Fenced Memory In Linux?


inbound - 3:06 pm on Jul 21, 2009 (gmt 0)


I'm not a regular in the Linux forum, probably know just enough to be dangerous, so please be gentle if I ask dumb questions.

I've got a situation which requires the allocation of large amounts of memory for a C++ program which absolutely must not be tampered with by the OS, even if there is a shortage of memory elsewhere (which would be unlikely).

What I'm thinging of is something along the lines of having servers with 24GB of RAM and only allowing the OS to address the first 8GB for what it needs, with the remaining 16GB being reserved at start-up so that the C++ program can directly address that space in the knowledge that nothing else will use it. (the machines will be running a still-to-be-decided 64 bit version of Linux, if a flavour of Linux makes it easier to ring-fence memory we may pick that version simply for that feature alone).

Is this possible? Am I mad?

I should say that, depending on what data any given machine is holding, the actual data size may be larger or smaller but there would always be at least 8GB of memory for the OS - which we never get anywhere near using in normal usage. The allocated RAM holds huge lookup tables - some may extend to 128GB on a 144GB machine (these tables will be used for very random lookups and lots of them, up to hundreds of millions a second - hence the OS swapping out lookup tables would be very bad for performance).


Thread source:: http://www.webmasterworld.com/linux/3956595.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com