在 Tomcat 中重新部署之前如何监控 PermGen 空间使用情况

编程入门 行业动态 更新时间:2024-10-28 08:16:00
本文介绍了在 Tomcat 中重新部署之前如何监控 PermGen 空间使用情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

为了确定在下一次重新部署后 jvm 是否可能会遇到 permgen 空间短缺,我想事先监视当前的 permgen 空间使用情况

In order to decide if the jvm is likely to run into a permgen space shortage after the next redeplyoment I'd like to monitor the current permgen space usage before hand

类似:

set myPermGenThreshold = 0.51  (51%)
currentlyUsedPermGenSize = (...ask the jvm here... say it's 0.6)

if (currentlyUsedPermGenSize > myPermGenThreshold ) {
 (...restart tomcat...)
}
else {
  (...redeploy application...)
}

推荐答案

Memory MX Bean 将为您提供所有非堆使用,其中 perm gen 是其中的一部分.烫发池本身的大小应该可以使用 Memory Pool MX Bean,但请注意池的名称是实现和 GC 相关的.

The Memory MX Bean will give you all non-heap usage, of which the perm gen is a part. The size of the perm gen pool itself should be available using the Memory Pool MX Bean, but be aware that the names of the pools are implementation and GC-dependent.

像往常一样,这两个 JMX bean 都可以从平台服务器获得,因此它们应该可以使用 JMX 客户端.

Both of these JMX beans are available from the platform server, as usual, so they should be obtainable externally using a JMX client.

编辑 - 链接更新至 1.7.

Edit - links updated to 1.7.

这篇关于在 Tomcat 中重新部署之前如何监控 PermGen 空间使用情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 03:52:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1389244.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:情况   空间   Tomcat   PermGen

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!