Java Garbage Collection Induced Latency affecting Performance -
i'm noticing weird phenomenon in application. store objects in hashmap after submitting them server , remove them when response arrives.
i noticed slow performance after running. upon checking, discovered memory usage stays @ 4gb , drops less 1 gb. suspect cleaning lot of objects that's why performance gets bad.
so question why taking java garbage collect late? is, why wait until heap full , garbage collection? shouldn't collect garbage @ regular intervals.
the objects gets stored in hashmap gets created right @ time, not long lived.
this on linux (rhel), oracle jvm hotspot 7. 64-bit. 4 cores. how app run:
java -jar -xmx4g prog.jar
note: have seen this: tuning garbage collections low latency want understand why gc taking long kick in?
it sounds have 1 of 2 issues going on:
- if have semi-long lived objects, moved young generation older (like on hotspot mark-compact generation.) is, they'll stop being reference counted collection , start being retained slower gc.
- your young generation heap space small usage pattern forcing objects moved young older generation.
i'd @ tuning young generation larger. see generational garbage collection , @ various types of generations.
Comments
Post a Comment