parasietje
parasietje

Reputation: 1539

VisualVM profiling is polluting results

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?

Upvotes: 1

Views: 763

Answers (2)

MartinZ
MartinZ

Reputation: 438

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.

Upvotes: 3

Peter Lawrey
Peter Lawrey

Reputation: 533432

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.

Upvotes: 1

Related Questions