gpt4 book ai didi

java - Tomcat 服务器内存泄漏

转载 作者:行者123 更新时间:2023-12-01 15:08:38 24 4
gpt4 key购买 nike

我尝试在 Debug模式下运行我的 Tomcat 7 服务器,它几乎已启动,但立即停止了。

您可以在下面找到一些日志:

INFO: Starting ProtocolHandler ["http-apr-8080"]
Sep 27, 2012 4:56:04 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 22573 ms
Sep 27, 2012 4:56:04 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
at java.net.ServerSocket.bind(ServerSocket.java:319)
at java.net.ServerSocket.<init>(ServerSocket.java:185)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:421)
at org.apache.catalina.startup.Catalina.await(Catalina.java:707)
at org.apache.catalina.startup.Catalina.start(Catalina.java:653)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:304)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Sep 27, 2012 4:56:04 PM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["http-apr-8080"]
Sep 27, 2012 4:56:05 PM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["ajp-apr-8009"]
Sep 27, 2012 4:56:05 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Sep 27, 2012 4:56:06 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Sep 27, 2012 4:56:06 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Sep 27, 2012 4:56:06 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/dnweb.myeclipse.bak] appears to have started a thread named [Thread-5] but has failed to stop it. This is very likely to create a memory leak.
Sep 27, 2012 4:56:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/DNClientWeb] appears to have started a thread named [Thread-2] but has failed to stop it. This is very likely to create a memory leak.
Sep 27, 2012 4:56:07 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/DNClientWeb] appears to have started a thread named [Thread-3] but has failed to stop it. This is very likely to create a memory leak.
Sep 27, 2012 4:56:07 PM org.apache.coyote.AbstractProtocolHandler stop
INFO: Stopping ProtocolHandler ["http-apr-8080"]

启动我的服务器后,它返回到停止模式。这些都是内存泄漏的问题。如果是的话我该如何解决这个问题。

任何建议,非常感谢。谢谢。

最佳答案

Tomcat 未启动可能是端口已被使用的问题,正如 @ThorstenDittmar 已经建议的那样,否则 Tomcat 会因一些 OutOfMemoryError 而死掉。

对于内存泄漏,您可以尝试通过使用 Java Visual VM 查看 JVM 堆转储来找出哪些实例保留在内存中,并防止旧的类加载器被垃圾收集。查看this article这解释了如何找到旧的类加载器以及仍然引用它们的实例。

关于java - Tomcat 服务器内存泄漏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12620391/

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