已使用,已提交和最大堆内存的差异 [英] Difference in Used, Committed and Max Heap Memory

查看:745
本文介绍了已使用,已提交和最大堆内存的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在监视OutOfMemoryException的spark执行器JVM。我使用Jconsole连接到执行程序JVM。以下是Jconsole的快照:

I am monitoring a spark executor JVM of a OutOfMemoryException. I used Jconsole to connect to executor JVM. Following is the snapshot of Jconsole:

在图像中使用的内存显示为3.8G和已提交的内存是8.6G和最大内存也是8.6G
任何人都可以解释使用和提交内存之间的区别或解释它的任何链接。

In the image used memory is shown as 3.8G and committed memory is 8.6G and Max memory is also 8.6G Could anyone explain the difference between Used and Committed Memory or any link which explains it.

推荐答案

来自的Java文档 MemoryUsage

getUsed is:

getUsed is:


以字节为单位的已用内存量

the amount of used memory in bytes

getCommitted()

getCommitted()


返回以字节为单位的内存量已提交要使用的Java
虚拟机。保证
Java虚拟机使用的内存量。

Returns the amount of memory in bytes that is committed for the Java virtual machine to use. This amount of memory is guaranteed for the Java virtual machine to use.

getMax()

getMax()


返回可用于
内存管理的最大内存量(以字节为单位)。如果最大内存大小
未定义,则此方法返回-1。

Returns the maximum amount of memory in bytes that can be used for memory management. This method returns -1 if the maximum memory size is undefined.

如果内存
管理,则不保证此内存量可用它大于提交的内存量。即使
已用内存的数量未超过此最大大小,
Java虚拟机也可能无法分配内存。

This amount of memory is not guaranteed to be available for memory management if it is greater than the amount of committed memory. The Java virtual machine may fail to allocate memory even if the amount of used memory does not exceed this maximum size.

这篇关于已使用,已提交和最大堆内存的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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