JAVA garbage collection parameters and log formats

Source: Internet
Author: User

-XX:-PrintGC

Disabled by default

Enable GC log printing.

For example:

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

This option can be dynamically enabled through com. sun. management. HotSpotDiagnosticMXBean API and Jconsole.

For details, see
Http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump

-XX:-PrintGCDetails

Introduced in 1.4.0, disabled by default

Print GC recovery details.

For example:

[Full GC (system) [tenured: 0 k-> 2394 K (466048 K), 0.0624140 secs] 30822 K-> 2394 K (518464 K), [perm: 10443 K-> 10443 K (16384 K)], 0.0625410 secs] [times: User = 0.05 sys = 0.01, real = 0.06 secs]

This option can be dynamically enabled through COM. Sun. Management. hotspotdiagnosticmxbean API and jconsole.

For details, see
Http://java.sun.com/developer/technicalArticles/J2SE/monitoring/#Heap_Dump

-XX:-printgctimestamps

Disabled by default

Print GC pause time.

For example:

2.744: [Full GC (system) 2.744: [tenured: 0 k-> 2441 K (466048 K), 0.0598400 secs] 31754 K-> 2441 K (518464 K), [perm: 10717 K-> 10717 K (16384 K)], 0.0599570 secs] [times: User = 0.06 sys = 0.00, real = 0.06

Secs]

This option can be dynamically enabled through COM. Sun. Management. hotspotdiagnosticmxbean API and jconsole.

For details, see

Http://java.sun.com/developer/technicalArticles/J2SE/monitoring

 

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


[GC [<collector >:< starting occupancy1>-> <ending occupancy1>, <pause time1> secs] <starting occupancy3>-> <ending occupancy3>, <pause time3> secs]


Where

<Collector> is an internal name for the collector used in the minor collection

<Starting occupancy1> is the occupancy of the young generation before the collection

<Ending occupancy1> is the occupancy of the young generation after the collection

<Pause time1> is the pause time in seconds for the minor collection.

<Starting occupancy3> is the occupancy of the entire heap before the collection

<Ending occupancy3> is the occupancy of the entire heap after the collection

<Pause time3> is the pause time for the entire garbage collection. This wocould 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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.