Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best GC for Java daemon [closed]

Just to clarify a point I seen here indirectly answered:

Is the best GC to use on multi-CPU / multi-Core machine, which mostly runs the application, is ConcurrentMarkSweeper (aka -XX:+UseConcMarkSweepGC)?

Also, there is something called G1, any idea when it will become available for Java6 ?

EDIT: I'm using Sun Java VM, 1.6.0_16-b01. I have real-time (as close to real-time as possible in Java) application, and naturally want GC sweeps to be as short as possible. There is plenty of CPU power (which ConcMarkSweep seems to require).

Thanks.

like image 215
SyBer Avatar asked Feb 28 '23 19:02

SyBer


1 Answers

It depends on what type of tolerance the application has for GC pauses. ConcurrentMarkSweep is best for reducing the size of the GC pauses and therefore latency while the Parellel GC will achieve the best throughput at the expense of longer GC pauses.

G1 is currently an experimental feature. I think it will not be generally available until Java7 is released.

I recommend you take a look at this page: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html

It contains a lot of information about the GC algorithms and behaviour. There is a section with advice for selecting the best GC for your application: http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#available_collectors.selecting

like image 178
Aaron Avatar answered Mar 06 '23 00:03

Aaron