tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: HOW TO: How do I allocate memory in JVM for extra virtual hosts
Date Mon, 30 Sep 2002 12:22:14 GMT
Hi,

> Check out perc 3.3 at http://www.newmonics.com/info/gc.shtml, it has a
>pretty decent GC performing much better than Sun's. Also IBM's JVM is
>pretty
>good too.

Please define "performing much better" ?

For our app benchmarks, JDK 1.4 GC was substantially better than PERC
3.3.  

I love how the PERC page still says "generational garbage collection"
like it's a big new thing.  Have you experimented with the train and
concurrent parallel GCs in JDK 1.4 and compared them (seriously compared
them, with hprof / another profiler and/or a heap analyzer)?

>I am not aware of all the performance implications of
>this, but it should be possible to create a Thread to
>run on some interval you define which just infinitely
>loops a call for garbage collection (gc() right?) then
>goes back to sleep until next iteration.

System.gc() is a suggestion.  It doesn't guarantee GC will run.  You
don't want to do it anyways.  The JDK internally is better at detecting
when to run GC and what type of GC to do, on what segment.

Spend your time tuning the parameters, e.g. Xmx, Xms, XX:NewSize,
XX:MaxNewSize, min and max free percentages, etc.  Analyze the results
seriously, don't go for "seat of the pants, this seems better" testing.

FYI, we have several large (>1G heaps) JVMs.  We have run into long GCes
in the past, until we just set aside several weeks to researching and
tuning the GC.  The results were excellent.  As mentioned above, it was
then that we experimented with alternative JDKs, including IBM, PERK,
jRockit, and others.  

>At least then you can control how often garbage
>collection happens, and I suppose it is possible that

No you don't control it.  It's only a suggestion.  In fact, JDK 1.4
supports a switch that says to completely ignore System.gc() calls, so
if you server admin uses this switch System.gc() does nothing.

To get started, see:
http://java.sun.com/docs/hotspot/gc/index.html
http://java.sun.com/docs/hotspot/VMOptions.html
http://wireless.java.sun.com/midp/articles/garbage/

Good luck,

Yoav Shapira
Millennium ChemInformatics

Mime
View raw message