Question about delete past data

Questions about YourKit Java Profiler
Post Reply
beckam
Posts: 2
Joined: Sat Aug 26, 2017 7:40 am

Question about delete past data

Post by beckam »

Hello everyboydy.

I am doing a memory profiling of 10 Use Cases, one by one. I capture the snapshot for use case 1 and then would like to clear off the data for it and then start cleanly for the new snapshot. The snapshot size becomes huge otherwise, runs into gigs and thats what I am trying to avoid.

I suspect that it keeps adding the data and for all subsequent snapshots the size becomes bigger and bigger - so for e.g. I would get a snapshot of size 200 MB for the 1st Use Case and then 400 MB for the 2nd one and then 600 MB for 3rd one and so on - keeps increasing.

I don't want to restart the App Server everytime to start fresh profiling. Is there a way to do this - erase existing profiling captured data and then start freshly. The command line options do offer to clean alloc, cpu and monitor data - but its not really reducing the size of my snapshots.

Thank you very much!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Question about delete past data

Post by Anton Katilin »

Memory snapshot size is mostly determined by the Java heap objects it describes.

Memory snapshot always contains information about all objects existing in the heap at the moment of capture. There is no way to filter objects at the moment of capture.

Please try capturing performance snapshots instead to see whether and how their size changes in time. Since memory snapshot contains heap information + a performance snapshot, you may check which part contributes to the size growth.

If as the result you see that the performance snapshot part is not responsible, there is no way to reduce the memory snapshot size except than to modify you application such that the heap contains fewer objects.

I can only suggest to explicitly force garbage collection several times in a row before capturing the memory snapshot to make the unreachable objects go away.
Post Reply