Are you still paying for unused memory when your Java app is idle? - Java SDK
The Hotspot™ JVM has an option called –XX:-ShrinkHeapInSteps, which shrinks the heap to its actual usage after every full garbage collection (GC) cycle. But this has a drawback; the onus is on the application developer to figure out when the application is idle and then call System.gc()
.
There are some Java agents on the market that make use of the Hotspot option to automatically maintain the heap at the optimal size. But there is a drawback to these external agents too. They are not completely aware of the internal characteristics or state of the heap in order to make an informed decision about triggering a GC cycle. The agent makes decisions based on some heuristics, which might negatively impact application performance if the GC cycle is not timed correctly.
Wouldn't it be better if your JVM, which does knows the exact state of the Java heap and the application, could recognize when your application is idle and take the opportunity to reduce the memory footprint?
Read full article from Are you still paying for unused memory when your Java app is idle? - Java SDK
No comments:
Post a Comment