NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mlockall() semantics



Hi, could anyone explain to me the semantics of mlockall() with many
variable memory allocations.

This is the scenario:

I run a process that does the following:

Call mlockall(MCL_FUTURE)

Run a loop, calling malloc() for a large number of objects. Object vary
is size, from 1K to 1MB. Total memory allocated is about 1GB.

Looking at the output of 'top' command, it shows 'Wired' memory to be
666MB, which is much less than 1GB.

proc.curproc.rlimit.memorylocked.hard = 2093928448
ulimit -l is set to unlimited

The mlock() man page says that locked memory should be multiple of page
size. Is this the reason why mlockall() above only managed to lock
666MB? Where does the wastage occur?


Home | Main Index | Thread Index | Old Index