mmap()

Michael Conlen m at obmail.net
Wed Nov 23 07:48:17 PST 2005


Sorry if this is the wrong place for this, but I haven't been getting  
answers elsewhere.

I'm trying to tune the system to allow very large mmap()'s in a  
single process space, something on the order of 1.5 GB so I can pass  
very large values for -Xms and -Xmx to java. I know I had been able  
to do this on FreeBSD in the past but recent versions of either Java  
or FreeBSD aren't playing nicely.  currently..

I'm running

FreeBSD host 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Tue Nov 22 00:22:53  
EST 2005     root at host:/usr/obj/usr/src/sys/WWW  i386

I've also tried the following under 5.4-p1...

I try

         rc = mmap(0, (891*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE,  
-1, 0);

and it works but If I try

         rc = mmap(0, (892*1024*1024 + 0), 0, MAP_ANON | MAP_PRIVATE,  
-1, 0);

it fails returning ENOMEM.

limit returns

cputime      unlimited
filesize     unlimited
datasize     2096128 kbytes
stacksize    1048576 kbytes
coredumpsize unlimited
memoryuse    unlimited
vmemoryuse   unlimited
descriptors  11095
memorylocked unlimited
maxproc      5547
sbsize       unlimited

If the program isn't doing anything else but that is there any reason  
I'm getting limited in the amount of memory I can mmap() at about 892  
MB? Ideally I'd like to be able to mmap most of the 2 GB available to  
user procs.

Oh, yes, there's plenty of free memory and swap.

Thanks




More information about the freebsd-performance mailing list