Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best GC and memory configuration for a real-time system that wants to minimize GC latency on a regular Sun/Oracle Hotspot JVM?

The question pretty much says it all. What supported JVM GC should we use and with what configuration to minimize GC impact in the application?

EDIT: Linux Ubuntu 64-bit:

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
like image 207
JohnPristine Avatar asked Mar 26 '12 23:03

JohnPristine


1 Answers

Starting in J2SE 5.0, the parallel collector is selected by default on server-class machines as detailed in the document Garbage Collector Ergonomics. In addition, the parallel collector uses a method of automatic tuning that allows desired behaviors to be specified instead of generation sizes and other low-level tuning details. The behaviors that can be specified are:

Maximum garbage collection pause time Throughput Footprint (i.e., heap size) The maximum pause time goal is specified with the command line option -XX:MaxGCPauseMillis=. This is interpreted as a hint that pause times of milliseconds or less are desired; by default there is no maximum pause time goal. If a pause time goal is specified, the heap size and other garbage collection related parameters are adjusted in an attempt to keep garbage collection pauses shorter than the specified value. Note that these adjustments may cause the garbage collector to reduce the overall throughput of the application and in some cases the desired pause time goal cannot be met.

Excerpted from http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html#par_gc.ergonomics

like image 179
Java42 Avatar answered Sep 18 '22 21:09

Java42