进程内存vs堆 - JVM(Process Memory Vs Heap — JVM)

我们在tomcat服务器上部署了一个Web应用程序。 我们运行了一些预定的工作,然后堆内存达到峰值并稳定下来,一切似乎都很好。 然而,系统管理员抱怨说,内存使用量(Linux上的“最高”)持续增加,计划的作业越多。 堆内存和CPU的内存之间的关系是什么? 它可以通过任何JVM设置进行控制吗? 我使用JConsole来监视系统。 我强制通过JConsole进行垃圾回收,并且堆使用率降低了,但是Linux上的内存使用率仍然很高,并且从未减少。

任何想法或建议会有很大的帮助?

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?

最满意答案

可能观察到的是虚拟大小而不是Java进程的驻留集大小? 如果您的目标只占用较小的空间,则可能不希望在JVM堆参数中包含-Xms或任何最小大小,并将70% -XX:MaxHeapFreeRatio=调整为较小的数字以允许更积极的堆收缩。

同时,提供关于Linux内存永不减少的评论的更多细节? 什么指标?

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 -Xms or 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?

进程内存vs堆 - JVM(Process Memory Vs Heap — JVM)

我们在tomcat服务器上部署了一个Web应用程序。 我们运行了一些预定的工作,然后堆内存达到峰值并稳定下来,一切似乎都很好。 然而,系统管理员抱怨说,内存使用量(Linux上的“最高”)持续增加,计划的作业越多。 堆内存和CPU的内存之间的关系是什么? 它可以通过任何JVM设置进行控制吗? 我使用JConsole来监视系统。 我强制通过JConsole进行垃圾回收,并且堆使用率降低了,但是Linux上的内存使用率仍然很高,并且从未减少。

任何想法或建议会有很大的帮助?

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?

最满意答案

可能观察到的是虚拟大小而不是Java进程的驻留集大小? 如果您的目标只占用较小的空间,则可能不希望在JVM堆参数中包含-Xms或任何最小大小,并将70% -XX:MaxHeapFreeRatio=调整为较小的数字以允许更积极的堆收缩。

同时,提供关于Linux内存永不减少的评论的更多细节? 什么指标?

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 -Xms or 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?