简体   繁体   中英

How JAXBContext.newInstance can cause memory leak

我已经阅读了很多文章(例如thisthisthis ),并且它们表明JAXBContext.newInstance导致了内存泄漏,现在我的理解是,一旦方法执行结束,则在该方法内部创建的所有本地对象都可以使用GC,所以我想知道JAXBContext.newInstance是如何引起内存的。

One of the reasons is that JAXB runtime uses ThreadLocal here and there , sometimes static. This may be a source of memory leaks:

ThreadLocal & Memory Leak

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM