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?


lammert - 10:52 am on Jul 26, 2009 (gmt 0)


There is no need to turn of swapping and it can be dangerous in some situations because the OS has no escape route when temporary memory spikes occur, for example during scheduled backup tasks.

I have created many real-time embedded software running on Linux. You can mark currently allocated memory and in the future to be allocated memory of your processes as locked in RAM. The call which you should put somewhere in your code is:

mlockall( MCL_CURRENT ¦ MCL_FUTURE );

You should know that many flavors of Linux by default only allow a small amount of memory (only 32 kB on Centos 5 for example) to be locked in memory. You should increase this system limit to your needs. The current setting of this limit (and others) can be viewed with the command ulimit -a.


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