0

尝试优雅地关闭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.
4

1 回答 1

0

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

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

于 2017-11-14T21:23:33.680 回答