java - 查找 JVM 端口库内存使用详细信息

标签 java memory jvm

这是来自正在运行的 IBM JVM (1.7) 的核心转储。
如何找到“端口库”内存的用途(185,624,064B)? “未使用”是什么意思?

    0SECTION       NATIVEMEMINFO subcomponent dump routine
NULL           =================================
0MEMUSER
1MEMUSER       JRE: 593,910,528 bytes / 7280 allocations
1MEMUSER       |
2MEMUSER       +--VM: 544,510,528 bytes / 5987 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Classes: 57,037,616 bytes / 1746 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Shared Class Cache: 16,777,312 bytes / 2 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Other: 40,260,304 bytes / 1744 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Memory Manager (GC): 276,343,080 bytes / 794 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Java Heap: 268,439,552 bytes / 1 allocation
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Other: 7,903,528 bytes / 793 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Threads: 22,618,136 bytes / 409 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Java Stack: 1,460,272 bytes / 66 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Native Stack: 20,054,016 bytes / 68 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Other: 1,103,848 bytes / 275 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Trace: 721,064 bytes / 418 allocations
2MEMUSER       |  |
3MEMUSER       |  +--JVMTI: 17,784 bytes / 13 allocations
2MEMUSER       |  |
3MEMUSER       |  +--JNI: 701,192 bytes / 1966 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Port Library: 185,624,064 bytes / 68 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Unused <32bit allocation regions: 185,614,504 bytes / 1 allocation
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Other: 9,560 bytes / 67 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Other: 1,447,592 bytes / 573 allocations
1MEMUSER       |
2MEMUSER       +--JIT: 48,401,712 bytes / 1182 allocations
2MEMUSER       |  |
3MEMUSER       |  +--JIT Code Cache: 18,874,368 bytes / 9 allocations
2MEMUSER       |  |
3MEMUSER       |  +--JIT Data Cache: 12,583,296 bytes / 6 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Other: 16,944,048 bytes / 1167 allocations
1MEMUSER       |
2MEMUSER       +--Class Libraries: 998,288 bytes / 111 allocations
2MEMUSER       |  |
3MEMUSER       |  +--Harmony Class Libraries: 2,000 bytes / 1 allocation
2MEMUSER       |  |
3MEMUSER       |  +--VM Class Libraries: 996,288 bytes / 110 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--sun.misc.Unsafe: 875,440 bytes / 33 allocations
4MEMUSER       |  |  |  |
5MEMUSER       |  |  |  +--Direct Byte Buffers: 463,392 bytes / 28 allocations
4MEMUSER       |  |  |  |
5MEMUSER       |  |  |  +--Other: 412,048 bytes / 5 allocations
3MEMUSER       |  |  |
4MEMUSER       |  |  +--Other: 120,848 bytes / 77 allocations

最佳答案

此内存保留用于某些 native 结构(一些与类和线程相关的数据),当使用 -Xcompressedrefs 时,这些结构需要位于底部 4GB 内存中。

预留保留了地址空间底部 4GB 的可用空间,这样就不会被不需要驻留在此处的其他分配所填满。

在最近的版本中,可以使用-Xmcrs选项配置预留的大小。请参阅:https://www-01.ibm.com/support/knowledgecenter/SSYKE2_7.0.0/com.ibm.java.aix.70.doc/diag/appendixes/cmdline/xmcrs.html

我的理解是,该空间在诊断中被标记为未使用,因为在子分配给特定用途之前它不受 RAM 支持,然后它将归属于另一个部分。因此,可用空间将随着时间的推移而缩小,除非需要更多空间,然后将保留一个新的(较小的) block 并将其添加到未使用的列表中。

关于java - 查找 JVM 端口库内存使用详细信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35155176/

相关文章:

java - 卡住最大堆空间选项

java - 具有 JPA 事务的 JAX-WS Web 服务

Java 字符串声明

Java:HashMap 内联初始化的性能影响

java - Jenkins服务器启动时“内存不足”

c++ - 内存泄漏会发生什么?

Java 类 : Anonymous vs Nested vs Private

Java - 计算总成本和未知数量的项目

java - 将百分比放入MySQL数据库

Java内存管理: Do static/non-static objects in various methods retained till end