JAVA : Why releasing Heap memory not reflecting in Task manager

Viewed 52

I am running an application with the following JVM paramaters,

-J-Xms2048m -J-Xmx2048m -J-XX:MaxMetaspaceSize=1024m -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-Djava.net.preferIPv4Stack=true"

When i launched the application ,

The heap memory is 120MB/2048MB and the memory shown for the particular process in Task manager(In Memory column - processes tab) is 680MB,

Now i run an intensive task,

My heap looks like this,

enter image description here

As seen, after launching application an intensive task is ran and after finishing it came back to previous state.

But, in Task manager (Physical memory) for the process has became around 2300MB from 680MB and its not coming down,

enter image description here

I am not able to understand what's the relation here..

Why When heap memory is released , the Physical memory is not going down ? - Is it because, allocating memory is costly and it is not relieving immediately?

0 Answers
Related