Our GC is working hard and we have some pauses that we want to decrease. We have some memory allocation issues that we want to solve before or while we are tweaking with the actual JVM GC args.
I would like to know which objects are making the GC sweat:
I am working extensively with Jprofiler and Memory Analyzer. I would like to get this information on a running application in my staging environment.
Using VisualVM (jvisualvm) jvisualvm is a tool to analyse the runtime behavior of your Java application. It allows you to trace a running Java program and see its the memory and CPU consumption. You can also use it to create a memory heap dump to analyze the objects in the heap.
Memory allocation in java occurs in two ways, mainly, stack and heap space.
Two kinds of memory. The JVM divides its memory into two main categories: heap memory and non-heap memory.
For 2 and 3, you can use the -XX:+PrintGCDetails
and -XX:+PrintGCTimeStamps
flags with either Oracle or OpenJDK java
executable during a run session of your application
For question 1, Phantom References can be used. This will allow you to be notified when an object is GC'ed (or GC-able).
As to the other two, I don't quite know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With