From owner-freebsd-java@FreeBSD.ORG Sat Apr 5 11:28:44 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 6B7DD106568A for ; Sat, 5 Apr 2008 11:28:44 +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 9A3218FC16 for ; Sat, 5 Apr 2008 11:28:43 +0000 (UTC) (envelope-from m.rogers@cs.ucl.ac.uk) Received: from 79-66-37-122.dynamic.dsl.as9105.com by bells.cs.ucl.ac.uk with Internet SMTP id ; Sat, 5 Apr 2008 12:28:27 +0100 Message-ID: <47F7627C.8090609@cs.ucl.ac.uk> Date: Sat, 05 Apr 2008 12:29:00 +0100 From: Michael Rogers User-Agent: Mozilla-Thunderbird 2.0.0.9 (X11/20080110) MIME-Version: 1.0 To: kurt@intricatesoftware.com References: <200804041633.30999.lists@intricatesoftware.com> In-Reply-To: <200804041633.30999.lists@intricatesoftware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-java@freebsd.org Subject: Re: 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: Sat, 05 Apr 2008 11:28:44 -0000 Kurt, Thank you so much, that solved the problem! Cheers, Michael Kurt Miller wrote: > 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@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-java >> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org" >> > >