我使用包裝在對象中的scala.collection.concurrent.TriMap
來存儲遠程獲取的配置值。在Scala和Tomcat中使用TriMap的潛在內存泄漏
object persistentMemoryMap {
val storage: TrieMap[String, CacheEntry] = TrieMap[String, CacheEntry]()
}
它工作得很好,但我注意到,當Tomcat關閉它記錄有關潛在的內存有些驚人的消息泄露
2013-jun-27 08:58:22 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
ALLVARLIG: The web application [] created a ThreadLocal with key of type [scala.concurrent.forkjoin.ThreadLocalRandom$1] (value [[email protected]]) and a value of type [scala.concurrent.forkjoin.ThreadLocalRandom] (value [[email protected]]) 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
我猜這個線程將終止它自己的最後,但我我想知道是否有某種方法可以殺死它,還是應該讓它獨自一人?