JDK-6855834 : G1: minimize the output when -XX:+PrintHeapAtGC is set
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: hs16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-06-29
  • Updated: 2013-09-18
  • Resolved: 2009-07-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u18Fixed 7Fixed hs16Fixed
Related Reports
Relates :  
Description
When -XX:+PrintHeapAtGC is set we call the print() method on G1CollectedHeap. This dumps the heap contents, one region at a time, which is overkill and makes the G1 verbose GC output unnecessarily long. We should make the -XX:+PrintHeapAtGC output more concise.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/0316eac49d5a
11-07-2009

SUGGESTED FIX I updated the format based on comments from John Coomes. Basically, I put region size and number of young / survivor regions on the same line and slightly changed their format. {Heap before GC invocations=12 (full 3): garbage-first heap total 26624K, used 22004K [0xf2400000, 0xf3e00000, 0xf5400000) region size 1024K, 16 young (16384K), 2 survivors (2048K) compacting perm gen total 16384K, used 3070K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf56ffa68, 0xf56ffc00, 0xf6400000) No shared spaces configured. 15.982: [GC pause (young) 21M->9990K(28M), 0.1216863 secs] Heap after GC invocations=13 (full 3): garbage-first heap total 28672K, used 9990K [0xf2400000, 0xf4000000, 0xf5400000) region size 1024K, 4 young (4096K), 4 survivors (4096K) compacting perm gen total 16384K, used 3070K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf56ffa68, 0xf56ffc00, 0xf6400000) No shared spaces configured. } {Heap before GC invocations=13 (full 3): garbage-first heap total 28672K, used 21584K [0xf2400000, 0xf4000000, 0xf5400000) region size 1024K, 16 young (16384K), 4 survivors (4096K) compacting perm gen total 16384K, used 3077K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf57016b8, 0xf5701800, 0xf6400000) No shared spaces configured. 16.570: [Full GC (System.gc()) 21M->566K(24M), 0.1898490 secs] Heap after GC invocations=14 (full 4): garbage-first heap total 24576K, used 566K [0xf2400000, 0xf3c00000, 0xf5400000) region size 1024K, 0 young (0K), 0 survivors (0K) compacting perm gen total 16384K, used 3075K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf5700dd0, 0xf5700e00, 0xf6400000) No shared spaces configured. }
08-07-2009

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/0316eac49d5a
08-07-2009

SUGGESTED FIX Instead of dumping information for all regions, the new format looks like this: {Heap before GC invocations=14 (full 4): garbage-first heap total 24576K, used 16950K [0xf2400000, 0xf3c00000, 0xf5400000) region size 1024K young regions 16 / 16384K survivor regions 0 / 0K compacting perm gen total 16384K, used 3077K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf57014c0, 0xf5701600, 0xf6400000) No shared spaces configured. 18.050: [GC pause (young) 16M->7684K(26M), 0.0515459 secs] Heap after GC invocations=15 (full 4): garbage-first heap total 31744K, used 7684K [0xf2400000, 0xf4300000, 0xf5400000) region size 1024K young regions 7 / 7168K survivor regions 7 / 7168K compacting perm gen total 16384K, used 3077K [0xf5400000, 0xf6400000, 0xf9400000) the space 16384K, 18% used [0xf5400000, 0xf57014c0, 0xf5701600, 0xf6400000) No shared spaces configured. } However, I have left in the ability to dump the extended per-region information, guarded by the new flag -XX:+PrintHeapAtGCExtended, given that it might be helpful for debugging. I also fixed a few small related things in the code: - passing the right boolean when calling increment_total_collections() (in the case of Full GC, the code before was not increasing the full GC counter) - moved the print_heap_before_gc() / print_heap_after_gc() calls from the gc_prologue() / gc_epilogue() methods to the methods that performance the collection, since the bracketing before was wrong.
06-07-2009

EVALUATION See Description.
29-06-2009