Subject: limit on locked memory
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 07/29/2004 18:42:11
Hi,
I'm trying to run memtest (pkgsrc/sysutils/memtester) on a box with
1GB RAM (i386, if that matters). memtest locks the memory it will work on,
but it seems that it's not possible to have more than about 332MB ram locked.
memtest will find out how much memory it can lock:
Allocated 352321536 bytes...trying mlock...failed:  insufficient resources.
Allocated 351272960 bytes...trying mlock...failed:  insufficient resources.
Allocated 350224384 bytes...trying mlock...failed:  insufficient resources.
Allocated 349175808 bytes...trying mlock...failed:  insufficient resources.
Allocated 348127232 bytes...trying mlock...success.  Starting tests...

starting a second instance of memtest it can lock a very small amout of
ram:
Allocated 950272 bytes...trying mlock...failed:  insufficient resources.
Allocated 933888 bytes...trying mlock...failed:  insufficient resources.
Allocated 917504 bytes...trying mlock...failed:  insufficient resources.
Allocated 901120 bytes...trying mlock...failed:  insufficient resources.
Allocated 884736 bytes...trying mlock...success.  Starting tests...

A third instance can't lock anything:
Allocated 6144 bytes...trying mlock...failed:  insufficient resources.
Allocated 5120 bytes...trying mlock...failed:  insufficient resources.
Allocated 4096 bytes...trying mlock...failed:  insufficient resources.
Allocated 3072 bytes...trying mlock...failed to align to pagesize of 4096 bytes.
Failed to get sufficient memory.  Exiting...


of course I raised all limits to the max, memorylocked and memoryuse are
unlimited, datasize is at 1GB.
Any idea of what is the limiting factor and if it's easy to raise ?
With this limit, I can only test 1/3 of the available RAM ...

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--