java - 已用、已提交和最大堆内存的差异

标签 java apache-spark memory-management jvm spark-streaming

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

图中已用内存显示为 3.8G,已提交内存为 8.6G,Max memory 也为 8.6G 谁能解释已用内存和已提交内存之间的区别或任何解释它的链接。

最佳答案

来自 MemoryUsage 的 Java 文档,

getUsed 是:

the amount of used memory in bytes

getCommitted()

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()

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.

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.

关于java - 已用、已提交和最大堆内存的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41468670/

相关文章:

java - 双括号初始化和序列化

java - 内存不足错误,我的应用程序的错?

python - 皮斯帕克。如何创建像这样的 df.shema ?

python - 如何从 Jupyter Pyspark 笔记本访问 MinIO 存储桶?

java - 如何刷新 webview 的缓存?

java - 什么是 NullPointerException,我该如何解决?

java - 热点默认最大堆大小

dynamic - 静态分配与动态分配与自动分配

apache-spark - Spark中使用中位数代替均值作为聚合函数

go - 如何将接口(interface)变量分配给另一个接口(interface)变量存储的值