JVM 进程与 JVM 堆内存使用情况 [英] JVM Process vs JVM Heap memory usage

查看:44
本文介绍了JVM 进程与 JVM 堆内存使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了这篇进程内存与堆 -- JVM我有同样的问题.

I have read through this Process Memory Vs Heap -- JVM and i have the same problem.

jvm 进程内存使用量不断增加,永不减少.我通过在 linux 服务器上做一个 top 来检查.应用程序正在将作业调度到集群(使用 Quartz + Sun Java DRMAA API)

The jvm process memory usage keeps increasing and never shrinks.I checked by doing a top on the linux server. The application is scheduling jobs to a cluster ( Using Quartz + Sun Java DRMAA API )

在应用程序生命周期中,java 堆空间保持在限制范围内,但 jvm 进程显示内存使用量稳步攀升并且从未下降.

The java heap space is staying within the limits during the application life cycle but the jvm process is showing a steady climb in memory usage and never coming down.

这是内存泄漏吗?如果是这样,为什么堆空间在限制范围内.谁能解释一下.

Is this a memory leak ? If so , why is heap space being within the limits. Can someone explain this.

更新:当我通过 jconsole 跟踪时,我有 -Xmx1600m -Xms1600m,我可以看到堆空间在这个限制范围内,大约 450m,但 top 命令显示进程使用了​​超过 900m.

UPDATE: I have -Xmx1600m -Xms1600m when i track through jconsole i can see the heap space well within this limit aroung 450m but the top command shows the process is using more than 900m.

推荐答案

使用的总虚拟内存为最大堆 + 线程堆栈 + 直接内存 + perm gen + 共享库的总和.这永远不会缩小.

The total virtual memory used is the sum of the maximum heap + thread stacks + direct memory + perm gen + share libraries. This never shrinks.

实际使用的主内存取决于占用了多少虚拟内存.共享库是共享的,因此拥有多个 JVM 不会导致内存翻倍等.

The actual main memory used depends on how much of the virtual memory has been occupied. Shared libraries are shared so having multiple JVMs won't result in this memory doubling etc.

JVM 永远不会向操作系统释放内存,但是如果主内存长时间不使用,则可以在需要时将其换出.

The JVM never releases memory to the OS, however if main memory is not used for a long time it can be swapped out if this is need.

这篇关于JVM 进程与 JVM 堆内存使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆