Performance of Java on FBSD vs. others...

Nick Johnson freebsd at spatula.net
Fri Nov 10 20:54:23 UTC 2006


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 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"
>

-- 
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/


More information about the freebsd-java mailing list