0

我正在使用 JRuby gem jmx 连接到远程 Tomcat 服务器并收集内存使用统计信息。在查询 Perm Gen 时,我可以返回 Committed、Init 和 Used 的值。查询 Max 返回值 'used'。

使用 JConsole,我可以看到 Perm Gen Max 的 bean 和字节数。代码片段:

client = JMX.connect(:host => host_name, :port => port)
memory = client['java.lang:type=MemoryPool,name=PS Perm Gen']

pg_max = memory.usage.max #returns 'used'
pg_committed = memory.usage.committed #returns the correct value
pg_used = memory.usage.used #returns the correct value
pg_init = memory.usage.init #returns the correct value

欢迎大家提出意见。提前致谢。

4

1 回答 1

-1

在我看来,memory.usage.max它类似于指向memory.usage.used.

可以memory.usage.used直接查询。

我在我的脚本中这样做。

于 2014-03-26T08:18:43.603 回答