From owner-freebsd-java@FreeBSD.ORG Fri Apr 4 20:33:41 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 1F61A1065671 for ; Fri, 4 Apr 2008 20:33:41 +0000 (UTC) (envelope-from lists@intricatesoftware.com) Received: from mail1.intricatesoftware.com (cl-18.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:11::2]) by mx1.freebsd.org (Postfix) with ESMTP id BD3DA8FC1E for ; Fri, 4 Apr 2008 20:33:40 +0000 (UTC) (envelope-from lists@intricatesoftware.com) Received: from seraph.intricatesoftware.com (relay@localhost.intricatesoftware.com [IPv6:::1]) by mail1.intricatesoftware.com (8.14.1/8.13.4) with ESMTP id m34KXWYw019304; Fri, 4 Apr 2008 16:33:33 -0400 (EDT) Received: from seraph.intricatesoftware.com (truk@localhost.intricatesoftware.com [127.0.0.1]) by seraph.intricatesoftware.com (8.14.1/8.14.1) with ESMTP id m34KXV1U003481; Fri, 4 Apr 2008 16:33:32 -0400 (EDT) Received: (from truk@localhost) by seraph.intricatesoftware.com (8.14.1/8.14.1/Submit) id m34KXVnv000254; Fri, 4 Apr 2008 16:33:31 -0400 (EDT) X-Authentication-Warning: seraph.intricatesoftware.com: truk set sender to lists@intricatesoftware.com using -f From: Kurt Miller To: freebsd-java@freebsd.org Date: Fri, 4 Apr 2008 16:33:30 -0400 User-Agent: KMail/1.9.9 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804041633.30999.lists@intricatesoftware.com> X-SMTP-Vilter-Version: 1.3.6 X-SMTP-Vilter-Virus-Backend: clamd X-SMTP-Vilter-Status: clean X-SMTP-Vilter-clamd-Virus-Status: clean X-Spamd-Symbols: ALL_TRUSTED,BAYES_00 X-SMTP-Vilter-Spam-Backend: spamd X-Spam-Score: -4.4 X-Spam-Threshold: 5.0 X-Spam-Probability: -0.9 X-SMTP-Vilter-Unwanted-Backend: attachment X-SMTP-Vilter-attachment-Unwanted-Status: clean Cc: Michael Rogers 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 Reply-To: kurt@intricatesoftware.com List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Apr 2008 20:33:41 -0000 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" >