mmap problem with diablo-1.5.0 on 6.1-RELEASE i386

Kurt Miller lists at intricatesoftware.com
Fri Apr 4 20:33:41 UTC 2008


Most of the memory the jdk uses is from mmap. Using a very high
data seg size ulimit has the effect of reducing the amount of memory
an application can mmap (at least on some FreeBSD versions). Try
reducing your data seg size ulimit to 819200 kbytes. The port versions
of the jdks do this automatically for you (e.g. cap data seg size to 800M).

-Kurt

On Friday 04 April 2008 11:35:47 am Michael Rogers wrote:
> Hi,
> 
> I'm having problems running Java on FreeBSD 6.1-RELEASE i386. The JVM seems 
> to be unable to allocate memory for the code cache using mmap. Here's what 
> I see on the command line:
> 
> ~ $ java -version
> Error occurred during initialization of VM
> Could not reserve enough space for code cache
> ~ $ uname -mrs
> FreeBSD 6.1-RELEASE i386
> ~ $ ulimit -a
> core file size          (blocks, -c) unlimited
> data seg size           (kbytes, -d) 2929687
> file size               (blocks, -f) unlimited
> max locked memory       (kbytes, -l) unlimited
> max memory size         (kbytes, -m) unlimited
> open files                      (-n) 11095
> pipe size            (512 bytes, -p) 1
> stack size              (kbytes, -s) 65536
> cpu time               (seconds, -t) unlimited
> max user processes              (-u) 5547
> virtual memory          (kbytes, -v) unlimited
> ~ $
> 
> Here's the tail of the kdump output:
> 
>  48178 java     CALL  mmap(0,0x2000000,0,0x1042,0xffffffff,0,0,0)
>  48178 java     RET   mmap -1 errno 12 Cannot allocate memory
>  48178 java     CALL  write(0x1,0xbfbfd2d0,0x2b)
>  48178 java     GIO   fd 1 wrote 43 bytes
>        "Error occurred during initialization of VM
>        "
>  48178 java     RET   write 43/0x2b
>  48178 java     CALL  write(0x1,0xbfbfd2d0,0x2d)
>  48178 java     GIO   fd 1 wrote 45 bytes
>        "Could not reserve enough space for code cache"
>  48178 java     RET   write 45/0x2d
>  48178 java     CALL  write(0x1,0xbb2ce361,0x1)
>  48178 java     GIO   fd 1 wrote 1 byte
>        "
>        "
>  48178 java     RET   write 1
>  48178 java     CALL  unlink(0x8064500)
>  48178 java     NAMI  "/tmp/hsperfdata_mrogers/48178"
>  48178 java     RET   unlink 0
>  48178 java     CALL  exit(0x1)
> 
> So it seems the mmap call is the problem, but I'm not sure why. I get the 
> same results with the installed version of Java and a fresh download of 
> diablo-1.5.0 from freebsdfoundation.org. I also have access to a FreeBSD 
> 6.2-RELEASE amd64 box where diablo-1.5.0 works fine; here's the 
> corresponding command line and kdump output for comparison:
> 
> ~ $ java -version
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build diablo-1.5.0-b01)
> Java HotSpot(TM) 64-Bit Server VM (build diablo-1.5.0_07-b01, mixed mode)
> ~ $ uname -mrs
> FreeBSD 6.2-RELEASE amd64
> ~ $ ulimit -a
> core file size          (blocks, -c) unlimited
> data seg size           (kbytes, -d) 33554432
> file size               (blocks, -f) unlimited
> max locked memory       (kbytes, -l) unlimited
> max memory size         (kbytes, -m) unlimited
> open files                      (-n) 11095
> pipe size            (512 bytes, -p) 1
> stack size              (kbytes, -s) 524288
> cpu time               (seconds, -t) unlimited
> max user processes              (-u) 5547
> virtual memory          (kbytes, -v) unlimited
> ~ $
> 
>  31867 java     CALL  mmap(0,0x3000000,0,0x1042,0xffffffff,0,0)
>  31867 java     RET   mmap 78553088/0x804aea000
>  31867 java     CALL  mmap(0x804aea000,0x270000,0x7,0x1012,0xffffffff,0,0)
>  31867 java     RET   mmap 78553088/0x804aea000
>  ... etc
> 
> Any thoughts on what could be causing this problem? Could it be something 
> to do with ulimit? Unfortunately I don't have root on either of the boxes 
> so I can't easily experiment with changing the limits.
> 
> Thanks in advance,
> Michael
> _______________________________________________
> freebsd-java at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe at freebsd.org"
> 




More information about the freebsd-java mailing list