From owner-freebsd-java@FreeBSD.ORG Fri Nov 10 20:54:23 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33DDD16A407 for ; Fri, 10 Nov 2006 20:54:23 +0000 (UTC) (envelope-from freebsd@spatula.net) Received: from turing.morons.org (morons.org [64.147.161.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A3A143D58 for ; Fri, 10 Nov 2006 20:54:21 +0000 (GMT) (envelope-from freebsd@spatula.net) Received: by turing.morons.org (Postfix, from userid 1001) id 11B4317048; Fri, 10 Nov 2006 12:54:25 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by turing.morons.org (Postfix) with ESMTP id 0DF6C1701B; Fri, 10 Nov 2006 12:54:25 -0800 (PST) Date: Fri, 10 Nov 2006 12:54:25 -0800 (PST) From: Nick Johnson X-X-Sender: spatula@turing To: Nikos Ntarmos In-Reply-To: <20061110203714.GA89006@ace.b020.ceid.upatras.gr> Message-ID: <20061110124459.M88944@turing> References: <20061110203714.GA89006@ace.b020.ceid.upatras.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-java@freebsd.org Subject: Re: Performance of Java on FBSD vs. others... 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, 10 Nov 2006 20:54:23 -0000 I suspect that even with only two threads, the threading implementation you use may make a difference. Check your /etc/libmap.conf and if it's easy to do, try again with the alternate thread implementations (libthr, libc_r) just for kicks. Refer to the man page for libmap.conf for an example. I'm not sure if the JVM uses shared memory segments, but you might want to sysctl -w kern.ipc.shm_use_phys=1 to keep shared memory from using swap. How are you setting your heap size? There could be performance differences between the memory allocators on different operating systems. What happens if you set -Xms and -Xmx to the same value (eg, 1024m) to get all of the allocation to happen up front? You might also play with /etc/malloc.conf if you find quirks of memory allocation. Are you using -client or -server? What about default GC tuning options? These can be platform-dependent. You may want to explicitly set these to compare apples to apples. I can't think of any other reason there'd be such a difference between OSes. Maybe someone else has some ideas. Nick On Fri, 10 Nov 2006, Nikos Ntarmos wrote: > Hi all. > > I've spent the last week or so running the exact same Java code on the > exact same hardware, under different OSs. The code i'm running is > heavily cpu-bound (no i/o other than light logging), uses a lot of > memory (~1G), and does not rely on threading libraries (i.e. the program > creates two threads when it starts and that's all about it). > > I'm running a small and a large version of the program (wrt memory > requirements and run-time). The average execution time for the small > version goes from ~200'' under win32, to ~220'' under linux, and to > ~800'' under freebsd. For the large version, the numbers are ~1600'' > for win32, ~1800'' for linux, and ~4700'' for freebsd. > > This is all on a 1.7GHz Pentium-M laptop with 1G RAM (dmesg at > http://ntarmos.dyndns.org/Computers/dmesgs/ace.dmesg), running -current > as of Sep 29. The JDKs tested are diablo-jdk15 (1.5.0.07.01) and > sun-jdk15 (1.5.0p6) for FreeBSD, and sun-jdk15 (1.5.0_07) for linux and > win32. > > Does anybody else see such a performance drop across OSs? Is there some > specific (known) reason why freebsd lags behind the other two OSs by > this 3x-4x factor? Any pointers as to some (sysctl or other) knob I've > missed? > > Thanks in advance. > > \n\n > _______________________________________________ > 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" > -- When you're a kid, they tell you it's all grow up, get a job, get married, get a house, have a kid, and that's it. No, the truth is the world is so much stranger than that. It's so much darker, and so much madder. And so much better. -- Elton, Doctor Who, "Love and Monsters" This message has been brought to you by Nick Johnson 2.1 and the number 6. http://healerNick.com/ http://morons.org/ http://spatula.net/