gpt4 book ai didi

java - 由于 xmlbeans 2.6.0.jar 导致内存泄漏

转载 作者:太空宇宙 更新时间:2023-11-04 13:23:21 25 4
gpt4 key购买 nike

我正在尝试创建一个包含 xmlbeans 2.6.0.jarxlsx 文件的项目。当我尝试重新启动 glassfish 时,出现以下错误。请任何人完成这个并帮助我

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.

最佳答案

这是a known issue of XML Beans图书馆。

您可以尝试遵循Jochen Kemnade的建议:

As a workaround, I moved the POI transformations to a dedicated thread pool which I shutdown when my webapp context is destroyed. This way, all the leaks go down with the pool and Tomcat's handler threads stay clean

Executor内部完成工作并摆脱它。

关于java - 由于 xmlbeans 2.6.0.jar 导致内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32864558/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com