0
以下の情報(特に現在の使用法)をプログラムで取得したいので、アプリケーションの "正常性ステータス"ページに表示することができます。このコードはJBoss 5.1で動作します。プログラムでjmapのような情報(ヒープ使用情報)を取得しますか?
$ jmap -heap 25837
[...]
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 1572864000 (1500.0MB)
NewSize = 1048576 (1.0MB)
MaxNewSize = 4294901760 (4095.9375MB)
OldSize = 4194304 (4.0MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 16777216 (16.0MB)
MaxPermSize = 268435456 (256.0MB)
Heap Usage:
PS Young Generation
Eden Space:
capacity = 332005376 (316.625MB)
used = 314099536 (299.5486602783203MB)
free = 17905840 (17.076339721679688MB)
94.60676203026303% used
From Space:
capacity = 42008576 (40.0625MB)
used = 5472256 (5.21875MB)
free = 36536320 (34.84375MB)
13.026521060842434% used
To Space:
capacity = 43122688 (41.125MB)
used = 0 (0.0MB)
free = 43122688 (41.125MB)
0.0% used
PS Old Generation
capacity = 456589312 (435.4375MB)
used = 316167864 (301.5211715698242MB)
free = 140421448 (133.91632843017578MB)
69.24556832377189% used
PS Perm Generation
capacity = 153092096 (146.0MB)
used = 93768952 (89.42504119873047MB)
free = 59323144 (56.57495880126953MB)
61.25002821830854% used
私はそこMBeanはこの情報を使用することですが、javax.management.j2ee.statistics.Statsは情報に非常に薄いです期待してJMXコンソールをチェックする:
で見つけたorg.jboss.management.j2ee.statistics.JVMStatsImpl [ {UpTime=[ 1097449:UpTime(description: Time the VM has been running, units: MILLISECOND, startTime: 1296748847668, lastSampleTime: 1296749945117) ], HeapSize=BoundedRangeStatistics[ [low: 0, high: 828243968, current: 828243968]HeapSize(description: Size of the VM's heap, units: Bytes, startTime: 1296748847672, lastSampleTime: 1296749945117), BoundryStatistics[ 0, 0, HeapSize(description: Size of the VM's heap, units: Bytes, startTime: 1296748847670, lastSampleTime: 0) ] ]} ]