1

I am using VisualVM memory profiling to analyse the memory allocation behavior of an application. Unfortunately, it seems the profiling process itself is polluting my results.

I continually see 80Mb being allocated over the timeframe of 5 minutes, which is due to memory profiling results being serialised over the JMXBean RMI connection. This memory is always in generation 1 and is immediately GC'd when I ask for it, but it is still annoying that this is showing up.

Can I filter memory profiling results based on the class that did the allocation?

parasietje
  • 1,529
  • 8
  • 36

2 Answers2

3

Try JProfiler, it does not use heap resources. You can see here:

Why does an empty Java program consume memory?

that visualvm even allocates lots of stuff when profiling an empty application.

Community
  • 1
  • 1
MartinZ
  • 428
  • 3
  • 3
1

I have found the same problem. For this reason I use a commercial profiler, such as YourKit, which uses a native agent for its profiling and doesn't use the heap or have much overhead.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130