From owner-freebsd-java@FreeBSD.ORG Fri Apr 4 15:48:03 2008 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDC69106564A for ; Fri, 4 Apr 2008 15:48:03 +0000 (UTC) (envelope-from M.Rogers@cs.ucl.ac.uk) Received: from bells.cs.ucl.ac.uk (bells.cs.ucl.ac.uk [128.16.5.31]) by mx1.freebsd.org (Postfix) with SMTP id 465B58FC23 for ; Fri, 4 Apr 2008 15:48:03 +0000 (UTC) (envelope-from M.Rogers@cs.ucl.ac.uk) Received: from bells3.cs.ucl.ac.uk by bells.cs.ucl.ac.uk with local SMTP id ; Fri, 4 Apr 2008 16:37:03 +0100 Received: from prayer by bells3.cs.ucl.ac.uk with local (Exim 4.54) id 1JhnxE-000Azq-GO for freebsd-java@freebsd.org; Fri, 04 Apr 2008 16:35:48 +0100 From: Michael Rogers Sender: M.Rogers@cs.ucl.ac.uk To: freebsd-java@freebsd.org Date: 04 Apr 2008 16:35:47 +0100 X-Mailer: Prayer v1.0.16 X-Originating-IP: [128.40.196.96] Message-ID: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=ISO-8859-1 Subject: mmap problem with diablo-1.5.0 on 6.1-RELEASE i386 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2008 15:48:04 -0000 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