首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >xmlbeans 2.6.0.jar导致的内存泄漏

xmlbeans 2.6.0.jar导致的内存泄漏
EN

Stack Overflow用户
提问于 2015-09-30 19:08:28
回答 2查看 1.9K关注 0票数 1

我正在尝试做一个项目,为我包含的xmlbeans 2.6.0.jar创建xlsx文件。当我尝试重新启动glassfish时,我得到了以下错误。请任何人来解决这个问题,并帮助我

代码语言:javascript
复制
Error:
Severe:   The web application [/test] created a ThreadLocal with
key of type [org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1]  
(value  
[org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl$1@4f7c1b38]) and 
a value of type [java.util.ArrayList] (value
[[java.lang.ref.SoftReference@51ec7f5b]]) 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.

Severe:   The web application [/test] created a ThreadLocal with 
key of type [org.apache.xmlbeans.impl.store.Locale$1] (value 
[org.apache.xmlbeans.impl.store.Locale$1@736da929]) and a value of 
type [java.lang.ref.SoftReference] (value 
[java.lang.ref.SoftReference@60681b99]) 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.

Severe:   The web application [/test] created a ThreadLocal with 
key of type [org.apache.xmlbeans.XmlBeans$1] (value 
[org.apache.xmlbeans.XmlBeans$1@4fe26977]) and a value of type 
[java.lang.ref.SoftReference] (value 
[java.lang.ref.SoftReference@7d46d177]) 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.
EN

回答 2

Stack Overflow用户

发布于 2016-01-22 00:04:37

这是a known issue of XML Beans库。

你可以试试Jochen Kemnade的建议:

作为一种变通方法,我将POI转换移动到一个专用的线程池中,当我的webapp上下文被破坏时,我将其关闭。这样,所有的泄漏都会随池一起下降,而Tomcat的处理程序线程会保持干净

Executor中完成工作,然后去掉它。

票数 0
EN

Stack Overflow用户

发布于 2019-08-08 01:55:55

自XMLBeans 3.1.0 (从Apache POI 4.1.0开始包含)以来,有一种方法可用于手动清除当前线程中XMLBeans中的所有线程本地变量:

代码语言:javascript
复制
org.apache.xmlbeans.ThreadLocalUtil.clearAllThreadLocals()

请参阅https://issues.apache.org/jira/browse/XMLBEANS-502http://xmlbeans.apache.org/status.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32864558

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档