jmap can know size of each generation, but I want to monitor my java process real time.
With jmx, MemoryMXBean.getHeapMemoryUsage().getUsed()
can get the total heap size. But I cannot find any method to get:
- Size of New (Young) and Tenured (Old) generations;
- Size of Eden and each Survivor in New generations.