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

Finding JVM Port Library memory usage details

这是来自 运行 IBM JVM (1.7) 的核心转储。
我如何找到用于 (185,624,064B) 的 "Port Library" 内存? "unused" 是什么意思?

    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

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

预留空间 space 在地址 space 的底部 4GB 中可用,因此它不会被其他不需要驻留在那里的分配填满。

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

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