【问题标题】:Tomcat memory leak warnings when gracefully shutting down - Codahale正常关闭时 Tomcat 内存泄漏警告 - Codahale
【发布时间】:2018-01-12 04:08:41
【问题描述】:

我在尝试正常关闭 tomcat 时遇到问题。发出此严重警告,应用程序将挂起,直到终止。在这种情况下,似乎与 codahale 有关,这与其他几个类似的问题不同。有关修复的任何建议。提前致谢。

(通过 Intellij 使用 Tomcat 7.0.78)

created a ThreadLocal with key of type 
[com.codahale.metrics.ThreadLocalRandom$1] (value 
[com.codahale.metrics.ThreadLocalRandom$1@7008afaf]) and a value of 
type [com.codahale.metrics.ThreadLocalRandom] (value 
[com.codahale.metrics.ThreadLocalRandom@cb6fe27]) but failed to remove 
it when the web application was stopped. Threads are going to be 
renewed over time to try and avoid a probable memory leak.

【问题讨论】:

标签: tomcat thread-local codahale-metrics


【解决方案1】:

这是一个未解决的问题:https://github.com/dropwizard/metrics/issues/742

com.codahale.metrics.ThreadLocalRandom 是由加载 Codahale 的同一个类加载器加载的类,因此该类具有对其类加载器的引用,从而防止所有其他类被垃圾收集。如果 codahale 是您的应用程序的一部分,那么您的所有类都不会被垃圾收集。 尝试将 codahale 放在 common/lib 而不是您的应用程序中,看看会发生什么。我认为这将允许您的应用程序被 gc-ed。

【讨论】:

    猜你喜欢
    • 2018-02-24
    • 2016-05-22
    • 2011-10-23
    • 1970-01-01
    • 2021-12-27
    • 1970-01-01
    • 2015-11-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多