Process Memory Vs Heap — JVM

后端 未结 3 1645
名媛妹妹
名媛妹妹 2020-12-09 05:58

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,

3条回答
  •  难免孤独
    2020-12-09 06:55

    The memory allocated by the JVM process is not the same as the heap size. The used heap size could go down without an actual reduction in the space allocated by the JVM. The JVM has to receive a trigger indicating it should shrink the heap size. As @Xepoch mentions, this is controlled by -XX:MaxHeapFreeRatio.

    However the system admin is complaining that memory usage ('top' on Linux ) keeps increasing the more the scheduled jobs are [run].

    That's because you very likely have some sort of memory leak. System admins tend to complain when they see processes slowly chew up more and more space.

    Any ideas or suggestions would of great help?

    Have you looked at the number of threads? Is you application creating its own threads and sending them off to deadlock and wait idly forever? Are you integrating with any third party APIs which may be using JNI?

提交回复
热议问题