JAVA垃圾收集参数与日志格式

-XX:-PrintGC

默认不启用

开启GC 日志打印。

 

例如:

[Full GC 131115K->7482K(1015808K), 0.1633180 secs]

 

该选项可通过 com.sun.management.HotSpotDiagnosticMXBean API 和 Jconsole 动态启用。

详见 http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump

-XX:-PrintGCDetails

1.4.0 引入,默认不启用

打印GC 回收的细节。

 

例如:

[Full GC (System) [Tenured: 0K->2394K(466048K), 0.0624140 secs] 30822K->2394K(518464K), [Perm : 10443K->10443K(16384K)], 0.0625410 secs] [Times: user=0.05 sys=0.01, real=0.06 secs]

 

该选项可通过 com.sun.management.HotSpotDiagnosticMXBean API 和 Jconsole 动态启用。

详见 http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump

-XX:-PrintGCTimeStamps

默认不启用

打印GC 停顿耗时。

 

例如:

2.744 : [Full GC (System) 2.744: [Tenured: 0K->2441K(466048K), 0.0598400 secs] 31754K->2441K(518464K), [Perm : 10717K->10717K(16384K)], 0.0599570 secs] [Times: user=0.06 sys=0.00, real=0.06

secs]

 

该选项可通过 com.sun.management.HotSpotDiagnosticMXBean API 和 Jconsole 动态启用。

详见 http://java.sun.com/developer/technicalArticles/J2SE/monitoring

 

The minor collection output for these options produce output of the form


[GC [: -> , secs] -> , secs]


where

is an internal name for the collector used in the minor collection

is the occupancy of the young generation before the collection

is the occupancy of the young generation after the collection

is the pause time in seconds for the minor collection.

is the occupancy of the entire heap before the collection

is the occupancy of the entire heap after the collection

is the pause time for the entire garbage collection. This would include the time for a major collection is one was done.

(1)Java SE 6 HotSpot[tm] Virtual Machine Garbage Collection Tuning

(2)Diagnosing a Garbage Collection problem

 

你可能感兴趣的:(Java,java,generation,output,api,system,include)