我的Java内存在哪里? [英] Where is my Java memory going?

查看:174
本文介绍了我的Java内存在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Ant或Eclipse的JUnit测试套件。 PermGen限制为200 MB,堆栈为1000 MB。

I am running a JUnit test suite from Ant or Eclipse. PermGen is limited to 200 MB, heap to 1000 MB.

Java VisualVM报告将PermGen分配为200 MB,并将堆分配为350 MB。这是550 MB。

Java VisualVM reports allocated PermGen as 200 MB and allocated heap as 350 MB. That's 550 MB.

但是,此进程的总虚拟集大小为2.5 GB,驻留集大小为1.8 GB。我知道应该有一些开销,但如果PermGen和堆是0.5 GB并且进程使用1.8 GB,那么缺少1.3 GB?我该如何诊断和修复它?

However, total virtual set size of this process is 2.5 GB, and resident set size is 1.8 GB. I understand there is supposed to be some overhead, but if PermGen and heap are 0.5 GB and the process is using 1.8 GB, where is the missing 1.3 GB? How can I diagnose and fix it?

推荐答案

什么是堆免费比率?您使用默认的70%和40%。也许,等待下一次gc运行会收集垃圾对象。也许java进程已经为自己分配了额外的内存(读取有关堆空闲比率)。

What is the heap free ratio? Are you using the default 70 and 40%. Maybe, there are garbage objects waiting to be collected by the next gc run. Also maybe the java process has allocated itself the extra memory (read about the heap free ratio).

也许在用Java调优垃圾收集参数提供了一些帮助。

Maybe the question/ answer/ comments mentioned at Tuning Garbage Collection parameters in Java offer some help.

这篇关于我的Java内存在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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