具有-Xmx1024m的Java进程如何占用3GB的驻留内存? [英] How can a Java process with -Xmx1024m occupy 3GB resident memory?

查看:363
本文介绍了具有-Xmx1024m的Java进程如何占用3GB的驻留内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是Websphere6.1,Solaris 10,JDK 1.5.0_13上的Java Web应用程序.我们将最大堆大小设置为1024m. jmap显示堆状态正常.堆内存使用率仅为57%.根本没有内存不足.

It's a Java web application on Websphere6.1, Solaris 10, JDK 1.5.0_13. We set the maximum heap size to 1024m. jmap shows the heap status is healthy. The heap memory usage is only 57%. No OutOfMemory at all.

但是我们从ps看到了用于此Java进程的非常高的RSS(3GB). pmap显示了一块1.9G的专用内存.

But we saw very high RSS (3GB) for this java process from ps. pmap shows a block of 1.9G private memory.


3785:   /dmwdkpmmkg/was/610/java/bin/java -server -Dwas.status.socket=65370 -X
 Address  Kbytes     RSS    Anon  Locked Pgsz Mode   Mapped File
...
0020A000    2008    2008    2008       -   8K rwx--    [ heap ]
00400000 1957888 1957888 1957888       -   4M rwx--    [ heap ]
8D076000      40      40      40       -   8K rw--R    [ stack tid=10786 ]
...

在本机代码中是否发生了C堆内存泄漏?建议使用哪种方法找出根本原因?

Is it a C heap memory leak in native code? What approach is recommended to find out the root cause?

推荐答案

This Troubleshooting Memory Leaks document from Sun may help you with finding the problem why your high RSS, specially in section 3.4.

在运行Websphere时,也许可以在VM上使用 -memorycheck .有关详细信息,请参见此处.

As you are running Websphere, maybe you can use the -memorycheck on your VM. For details see here.

不一定是本机代码泄漏.如果您在Solaris上此处,则文件可能存在问题保持开放状态.

It's not necessarily a leak in native code. If you look here, on Solaris there might be an issue with files being kept open.

这只是一堆链接和提示,但可能有助于您找出问题所在.

It's just a bunch of links and hints, but maybe helpful to track down your problem.

这篇关于具有-Xmx1024m的Java进程如何占用3GB的驻留内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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