We have a web application deployed on a tomcat server. There are certain scheduled jobs which we run, after which the heap memory peaks up and settles down, everything seems fine.
However the system admin is complaining that memory usage (‘top’ on Linux ) keeps increasing the more the scheduled jobs are.
Whats the co-relation between heap memory and memory of the CPU? Can it be controlled by any JVM settings? I used JConsole to monitor the system.
I forced the garbage collection through JConsole and the heap usage came down, however the memory usage on Linux remained high and it never decreased.
Any ideas or suggestions would of great help?
What is likely being observed is the virtual size and not the resident set size of the Java process(es)? If you have a goal for a small footprint, you may want to not include
-Xmsor any minimum size on the JVM heap arguments and adjust the 70%-XX:MaxHeapFreeRatio=to a smaller number to allow for more aggressive heap shrinkage.In the meantime, provide more detail as to what was observed with the comment the Linux memory never decreased? What metric?