Re: Want to allocate almost all the memory with no swap

James A. Sutherland
2001-04-19T15:41:02Z

On Thu, 19 Apr 2001 17:39:23 +0200 (MEST), you wrote:

>Hi,
>
>I'm currently trying to run a high-performance bench on a cluster of PCs
>under Linux. This bench is the Linpack test, and needs a lot of memory to
>store a matrix of numbers. Linpack needs to allocate as much as 240 Megs
>on a machine that has 256 Megs of RAM, but I have to be sure that the
>memory used by linpack will never be swapped on the disk.

Call mlockall() to lock all your memory into physical RAM - there's a
flag to set which ensures all your future allocations are locked as
well. You should be left with 16 Mb of physical RAM free, plus swap,
so you should be able to do this as long as the machine isn't too
heavily loaded at the time - no running Netscape during benchmarks :-)

James.