user1316516
user1316516

Reputation: 31

Analyze/visualize GC usage patterns between two versions of a program?

I just spent a few days greatly improving our software getting rid of lots of unnecessary object allocations. The improvements are dramatic, I can now run a process with (almost) no new objects being allocated. Megabytes upon megabytes of of objects just thrown away were created before my fixes.

Now, I want to visualize the improvements in some impressive way (it's all about measurable impact :). Any tips? I used VisualVM for lots of the instrumentation, but it doesn't really show much. The monitor shows something called "GC activity" but it's not that useful. Ideally I'd like to be able to keep a cumulative count of the size of all object created in the process before and after the fix. Any tools allowing me to do that?

Thanks!

Upvotes: 3

Views: 155

Answers (2)

Tomas Hurka
Tomas Hurka

Reputation: 6981

With VisualVM, you have two options. You can use Memory profiling, which tracks the number of allocated instances per class or you can use support for tracking of cumulative Java heap bytes allocated on a per-thread basis, which was added in VisualVM 1.3.3.

Upvotes: 0

Trent Gray-Donald
Trent Gray-Donald

Reputation: 2346

You can use GCMV. It supports a lot of different verbose GC formats and allows you to put comparison charts together. We often do that for memory leaks, etc.. where we want to show "before and after" stories.

It also does fun summaries around things like total GCs, total GC time, etc.. that look pretty compelling in these cases.

Upvotes: 2

Related Questions