garbage collection - How to determine the cause of young gc of a Java application -
recently found had frequent young gc in java app. since had 1600m young generation, , did young gc every 10 seconds, think there many unnecessary objects cause these gcs.
i know can use jmap heapdump find out cause full gc. how can find out what's in young gen (cause heapdump should clean young gen , young gen varying time)
and question : jstat -gcutil increase gc frequency?
option 1 - sjk's hh command using jmap underhood. if run --dead-young following.
- perform full gc
- wait 10 seconds (fresh garbage produced)
- take heap histogram without gc
- immediately take perform gc , take histogram (like jmap --live)
- compare 2 histogram , return difference - objects created in last 10 second , being collected.
option 2 - java mission control part of java 8 jdk. can sample object allocation on tlab allocation failures. while not accurate detecting garbage spots in practice.
jstat -gc
not perform gc, using information via memory mapped file. jvm dump metric file , jstat
polls it.
Comments
Post a Comment