Java堆大小未完全使用 [英] Java heap size not entirely used

查看:309
本文介绍了Java堆大小未完全使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用Visual VM监控我正在运行的java应用程序: http://visualvm.java.net/

I'm currently monitoring my running java application with Visual VM: http://visualvm.java.net/

我用--Xmx128m强调内存使用量。

I'm stressing the memory usage by with -Xmx128m.

运行时我看到了堆大小增加到128m(正如预期的那样)但是在遇到java堆空间错误之前,使用的堆收敛到大约105m。

When running I see the heap size increasing to 128m (as expected) however the used heap converges to approximately 105m before I run into a java heap space error.

为什么这些剩余的20米,未使用?

Why are these remaining 20m, not used?

推荐答案


堆在Young-Generation中被分割(Eden-Space和两个相同大小的Survivor-Spaces)通常称为From和To),Old Generation(Tenured)和Permanent Space。

The heap is split up in Young-Generation (Eden-Space, and two Survivor-Spaces of identical size usually called From and To), Old Generation (Tenured) and Permanent Space.

Xmx / Xms 选项设置整体堆大小。所以一个区域(默认大小)实际上是永久空间 - 也许,我们不知道你的压力测试的细节,实际上没有任何物体从伊甸园转移到终身或永久,所以这些区域仍然是空的,而伊甸园用完了空间。

The Xmx/Xms option sets the overall heap size. So a region (with a default size) is actually the Permanent Space - and maybe, we don't know details about your stress test, no objects are actually moved from eden to tenured or permanent, so those regions remain empty while Eden runs out of space.

这篇关于Java堆大小未完全使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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