On Wed, Oct 20, 2010 at 06:29:53PM +0100, Sad Clouds wrote: > Hi, I've been trying to figure out why it's not possible to lock more > than 666MB of memory, and I'm beginning to think it might be a kernel > issue. > > This is what I'm doing: > > Run program as root. > Lock only memory segments that are multiples of system page size. > ulimit -l is set to unlimited. > proc.curproc.rlimit.memorylocked.soft = 697976149 > proc.curproc.rlimit.memorylocked.hard = 2093928448 > > With all of the above set, for some reason it's not possible to lock > more than 666MB. > > Can anyone shed some light on this?
IIRCC: - Those two (soft/hard) numbers are calculated at process 0 initialization. - setrlimit(2) doesn't seem to handle RLIMIT_MEMLOCK. - mlock(2)/mlockall(2) refer to the "soft" counterpart. What if you change "proc.curproc.rlimit.memorylocked.soft" sysctl value from within the program?