Search code examples
javaprofilingjvisualvmmemory-profiling

Java memory profiling shows unusual object allocation and deallocation


I was memory-profiling a java application. I used JVisualVM tool for the same. However, it show that continuously objects are allocated and deallocated, despite the fact that my application is not doing any important task, which is shown in the image given below :- enter image description here

Can anyone give me the reason, for what process, java runtime environment is doing internally, which requires it to allocate and deallocate objects continuously ?

Thanks in advance.


Solution

  • That's a normal sawtooth pattern. The JVM isn't idle. There are most likely background threads running, and being connected to JVisualVM requires resources too.