I am running Apache Ignite application. When I see memory usage using linux free
I am getting used memory as 9.8 GB. But when I take heap dump using eclipse MAT, its size is only about 1.8 GB. Why is this happening? Default heap memory allocated in ignite is 21 GB. I have also not done any GC tuning.
When Eclipse takes the heap dump, it most likely forces full garbage collection so that you only see objects that are actually in memory. JVM itself does not do this because the heap is very large and there is still a lot of available memory. BTW, this will happen eventually making your Ignite node unresponsive for significant period of time. I would recommend not to allocate more than 10-12GB per node.