CRR (S): 7097048: G1: extend the G1 SA changes to print per-heap space information

Bengt Rutisson bengt.rutisson at oracle.com
Mon Oct 3 01:33:38 PDT 2011


Hi Tony,

The changes looks good except that I think you forgot to remove the if 
(false) section on lines 108-119 in HeapSummary.java.

Speaking of those lines of code. The region size and number of regions 
seems like relevant information to me. I don't know much about the SA 
agent. Is is possible to get this information in another way from the SA 
agent? Otherwise I would vote for including this information again.

Another question due to my lack of knowledge of the SA agent. Your 
logging now looks exactly like ParallelGC with a "From Space" and a "To 
Space". However, the "To Space" will always be 0. I understand this from 
a G1 perspective, but I can imagine that for a SA user this could be 
confusing. I would prefer to rename "From Space" to "Survivor Space" and 
remove the "To Space" section. It would then look slightly different 
than for ParallelGC, but it would make more sense.

Also, (unrelated to your changes) why does HeapSummary.printValMB() try 
to handle negative values? A signed long in Java should not have to 
overflow when we talk about memory sizes. Wouldn't it be more 
appropriate to to throw an exception, or just log the negative value?

Thanks,
Bengt


On 2011-10-01 01:27, Tony Printezis wrote:
> Could I have a couple of code reviews for some more changes to the SA 
> to ensure that the jmap -heap output for G1 is consistent with what's 
> generated for the other GCs (see example below)?
>
> http://cr.openjdk.java.net/~tonyp/7097048/webrev.0/
>
> Thanks,
>
> Tony
>
>
> jmap -heap with G1 before:
>
> ...
> Heap Usage:
> Garbage-First (G1) Heap
>   region size = 1048576 (1.0MB)
>   regions     = 20
>   capacity    = 20971520 (20.0MB)
>   used        = 7154320 (6.8228912353515625MB)
>   free        = 13817200 (13.177108764648438MB)
>   34.11445617675781% used
> Perm Generation:
>   capacity = 16777216 (16.0MB)
>   used     = 2570176 (2.45111083984375MB)
>   free     = 14207040 (13.54888916015625MB)
>   15.319442749023438% used
>
> jmap -heap with G1 after:
>
> ...
> Heap Usage:
> G1 Young Generation
> Eden Space:
>  capacity = 5242880 (5.0MB)
>  used     = 3145728 (3.0MB)
>  free     = 2097152 (2.0MB)
>  60.0% used
> From Space:
>  capacity = 1048576 (1.0MB)
>  used     = 1048576 (1.0MB)
>  free     = 0 (0.0MB)
>  100.0% used
> To Space:
>  capacity = 0 (0.0MB)
>  used     = 0 (0.0MB)
>  free     = 0 (0.0MB)
>  0.0% used
> G1 Old Generation
>  capacity = 14680064 (14.0MB)
>  used     = 6509792 (6.208221435546875MB)
>  free     = 8170272 (7.791778564453125MB)
>  44.34443882533482% used
> Perm Generation:
>  capacity = 16777216 (16.0MB)
>  used     = 2658904 (2.5357284545898438MB)
>  free     = 14118312 (13.464271545410156MB)
>  15.848302841186523% used
>
> jmap -heap with ParallelGC (for comparison):
>
> ...
> Heap Usage:
> PS Young Generation
> Eden Space:
>   capacity = 17301504 (16.5MB)
>   used     = 14982784 (14.2886962890625MB)
>   free     = 2318720 (2.2113037109375MB)
>   86.59815932765152% used
> From Space:
>   capacity = 2883584 (2.75MB)
>   used     = 0 (0.0MB)
>   free     = 2883584 (2.75MB)
>   0.0% used
> To Space:
>   capacity = 2883584 (2.75MB)
>   used     = 0 (0.0MB)
>   free     = 2883584 (2.75MB)
>   0.0% used
> PS Old Generation
>   capacity = 44040192 (42.0MB)
>   used     = 240248 (0.22911834716796875MB)
>   free     = 43799944 (41.77088165283203MB)
>   0.5455198742094494% used
> PS Perm Generation
>   capacity = 16777216 (16.0MB)
>   used     = 2574864 (2.4555816650390625MB)
>   free     = 14202352 (13.544418334960938MB)
>   15.34738540649414% used
>



More information about the hotspot-gc-dev mailing list