Web应用程序中的内存泄漏

时间:2013-11-13 15:34:30

标签: java memory-leaks

我有一个使用Netbeans IDE开发的Web应用程序。我从WSDL添加了一个Web服务。问题是每次部署它时它会变得越来越重。有时会让我的IDE崩溃。

我不知道如何解决这个问题。我在stackoverflow上阅读了其他问题,但他们只是建议扩展permSpace或类似的东西。我宁愿试着去理解出了什么问题,以及为什么我的空间没有被清除。

这是我在Tomcat的控制台中得到的:

INFO: WSSERVLET13: JAX-WS context listener destroyed
13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [com.sun.xml.bind.v2.runtime.Coordinator$1] (value [com.sun.xml.bind.v2.runtime.Coordinator$1@53c6a7fc]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@173ebc5c]) 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.
13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [org.glassfish.gmbal.generic.OperationTracer$1] (value [org.glassfish.gmbal.generic.OperationTracer$1@17c047f0]) and a value of type [java.util.ArrayList] (value [[]]) 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.
13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1@50b2e9be]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference@14a877c0, class com.sun.xml.ws.runtime.config.Tubelines=java.lang.ref.WeakReference@404de8d8, class java.util.ArrayList=java.lang.ref.WeakReference@3af1dde3, class com.sun.xml.ws.runtime.config.TubelineDefinition=java.lang.ref.WeakReference@5d1e8050, class com.sun.xml.ws.runtime.config.TubeFactoryList=java.lang.ref.WeakReference@7d7a33f2, class com.sun.xml.ws.runtime.config.MetroConfig=java.lang.ref.WeakReference@61e89539, class com.sun.xml.ws.runtime.config.TubeFactoryConfig=java.lang.ref.WeakReference@6c9d0366, class javax.xml.bind.annotation.adapters.CollapsedStringAdapter=java.lang.ref.WeakReference@384a553f}]) 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.
13-nov-2013 16.24.02 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/SOAPolls] created a ThreadLocal with key of type [org.glassfish.gmbal.generic.OperationTracer$1] (value [org.glassfish.gmbal.generic.OperationTracer$1@17c047f0]) and a value of type [java.util.ArrayList] (value [[]]) 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.
13-nov-2013 16.24.03 org.apache.catalina.startup.HostConfig deleteRedeployResources

我该怎么办?

另外:有没有办法手动清除我需要的空间,以便让我的应用程序运行更多一点(自从我接下来的几天开始考试后,这是一个临时解决方案)?

编辑:我尝试重启服务器。但是,当我尝试停止Tomcat时,IDE有时无法取消部署应用程序(并且一切都会卡住)。

1 个答案:

答案 0 :(得分:0)

解决方案是将所有需要的库文件(webservices * .jar,activation.jar)放在tomcat \ lib目录中,并从webapp WEB-INF \ lib中删除它们。