Free space calculation of heap
Bond Chen
Bond.Chen at lombardrisk.com
Fri Jun 1 02:48:05 PDT 2012
Hi,
Our application have suffer a bad fragmentation issue at production env, I need switch on lots of parameter to analysis the gc, but I'm not fully understand the all of the output.
By adding parameter -XX:PrintFLSStatistics=2 , The BinaryTreeDictionary and IndexedFreeLists of old gen and perm gen have been printed out
q1: the total free space + used space of old gen calculation from gc output is 128KB less than actual old gen capacity
q2: all counter of the BinaryTreeDictionary and IndexedFreeLists of perm gen is zero, why?
q3: what's the meaning of " frag=0.0045", fragmentation ratio? and can someone provide the formula?
q4: which parameter enables the "output log2 of gc log"? how to interpret the output
/**output log1 of gc log*/
67.016: [ParNew
Desired survivor size 111411200 bytes, new threshold 2 (max 32)
- age 1: 42577240 bytes, 42577240 total
- age 2: 74417368 bytes, 116994608 total
: 1512523K->153985K(1523200K), 0.2866570 secs] 1649586K->351496K(6000128K)After GC:
Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: 546527717
Max Chunk Size: 546527717
Number of Blocks: 1
Av. Block Size: 546527717
Tree Height: 1
Statistics for IndexedFreeLists:
--------------------------------
Total Free Space: 1221215
Max Chunk Size: 256
Number of Blocks: 39302
Av. Block Size: 31
free=547748932 frag=0.0045
After GC:
Statistics for BinaryTreeDictionary:
------------------------------------
Total Free Space: 0
Max Chunk Size: 0
Number of Blocks: 0
Tree Height: 0
Statistics for IndexedFreeLists:
--------------------------------
Total Free Space: 0
Max Chunk Size: 0
Number of Blocks: 0
free=0 frag=0.0000
, 0.2868167 secs] [Times: user=0.91 sys=0.13, real=0.29 secs]
Heap after GC invocations=6 (full 1):
par new generation total 1523200K, used 153985K [0xfffffd7e5ec10000, 0xfffffd7ec9010000, 0xfffffd7ec9010000)
eden space 1305600K, 0% used [0xfffffd7e5ec10000, 0xfffffd7e5ec10000, 0xfffffd7eae710000)
from space 217600K, 70% used [0xfffffd7eae710000, 0xfffffd7eb7d70438, 0xfffffd7ebbb90000)
to space 217600K, 0% used [0xfffffd7ebbb90000, 0xfffffd7ebbb90000, 0xfffffd7ec9010000)
concurrent mark-sweep generation total 4476928K, used 197511K [0xfffffd7ec9010000, 0xfffffd7fda410000, 0xfffffd7fda410000)
concurrent-mark-sweep perm gen total 524288K, used 238680K [0xfffffd7fda410000, 0xfffffd7ffa410000, 0xfffffd7ffa410000)
}
/***/
/**output log2 of gc log**/
2012-05-31T15:23:18.293+0800: 9.731: [CMS-concurrent-sweep-start]
size[1] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[2] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[3] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[4] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[5] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
...............................
size[250] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[251] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[252] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[253] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[254] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[255] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
size[256] : demand: 0, old_rate: 0.000000, current_rate: 0.000000, new_rate: 0.000000, old_desired: 0, new_desired: 0
demand: 1, old_rate: 0.000000, current_rate: 0.103071, new_rate: 0.103071, old_desired: 0, new_desired: 0
***/
Many Thanks
Bond
This e-mail together with any attachments (the "Message") is confidential and may contain privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this Message from your system. Any unauthorized copying, disclosure, distribution or use of this Message is strictly forbidden.
More information about the hotspot-gc-use
mailing list