gpt4 book ai didi

java - 64 位升级后关闭 Tomcat JVM 服务的时间更长

转载 作者:行者123 更新时间:2023-11-28 22:27:53 26 4
gpt4 key购买 nike

我有一个基于 Windows 2012 的服务器,它使用 wrapper.exe 运行 Tomcat 8 和 Java 7 实例作为 Windows 服务。

在我将我的服务迁移到 64 位 JVM 之后,我的服务关闭时间比平时更长,之前的关闭时间大约为 8-10 秒,现在长达 1 分钟。

以下是在我触发进程关闭后 10 秒后似乎仍然存在的线程。请让我知道真正可以触发此事件的原因。

13-Dec-2015 17:12:37.404 INFO [Thread-15] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-7000"]
13-Dec-2015 17:12:37.482 INFO [Thread-15] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-7443"]
13-Dec-2015 17:12:37.545 INFO [Thread-15] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-apr-7009"]
13-Dec-2015 17:12:37.607 INFO [Thread-15] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Server: Logger Manager] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:503)
com.MyCom.server.logger.LoggerManager.run(LoggerManager.java:193)
java.lang.Thread.run(Thread.java:745)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [DiskWriteThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
com.MyCom.server.logger.CacheToDiskWriter.run(CacheToDiskWriter.java:62)
java.lang.Thread.run(Thread.java:745)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [LogManagerMonitor thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
com.MyCom.server.logger.LogManagerMonitor.run(LogManagerMonitor.java:43)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [SNMPForwarderHBSendThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
snmp.SNMPForwarderHBSendThread._sleep(SNMPForwarderHBSendThread.java:68)
snmp.SNMPForwarderHBSendThread.run(SNMPForwarderHBSendThread.java:55)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [SNMPForwarderHBDeathClock] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
snmp.SNMPForwarderHBDeathClock._sleep(SNMPForwarderHBDeathClock.java:75)
snmp.SNMPForwarderHBDeathClock.run(SNMPForwarderHBDeathClock.java:62)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [SNMPForwarderReceiveThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.net.DualStackPlainDatagramSocketImpl.socketReceiveOrPeekData(Native Method)
java.net.DualStackPlainDatagramSocketImpl.receive0(DualStackPlainDatagramSocketImpl.java:121)
java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:145)
java.net.DatagramSocket.receive(DatagramSocket.java:786)
snmp.SNMPForwarderReceiveThread.run(SNMPForwarderReceiveThread.java:74)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [SNMPForwarderConnectionEstablisherThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
snmp.SNMPForwarderConnectionEstablisherThread._sleep(SNMPForwarderConnectionEstablisherThread.java:244)
snmp.SNMPForwarderConnectionEstablisherThread.run(SNMPForwarderConnectionEstablisherThread.java:223)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Log Purge Timer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:552)
java.util.TimerThread.run(Timer.java:505)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Server: License Expiration Checker] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Thread.sleep(Native Method)
com.MyCom.server.licensing.VXMLLicenseExpirationChecker.run(VXMLLicenseExpirationChecker.java:71)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Transport-reader-group-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
queue.LinkedMessageQueue.dequeue(LinkedMessageQueue.java:139)
queue.TransportMessageReaderWorker.singlePoll(TransportMessageReaderWorker.java:133)
queue.TransportMessageReaderWorker.run(TransportMessageReaderWorker.java:48)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [nioEventLoopGroup-2-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:296)
sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:278)
sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:159)
sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:622)
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:310)
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:110)
io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Global-task-executor-group-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1079)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [IvrProvider-writer-group-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
queue.LinkedMessageQueue.dequeue(LinkedMessageQueue.java:139)
queue.TransportMessageWriterWorker.singlePoll(TransportMessageWriterWorker.java:96)
queue.TransportMessageWriterWorker.run(TransportMessageWriterWorker.java:53)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
java.util.TimerThread.mainLoop(Timer.java:552)
java.util.TimerThread.run(Timer.java:505)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [StatsIntervalThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
statistics.StatsIntervalThread._sleep(StatsIntervalThread.java:95)
statistics.StatsIntervalThread.run(StatsIntervalThread.java:56)

13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [SNMPStatsThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
statistics.SNMPStatsThread._sleep(SNMPStatsThread.java:54)
statistics.SNMPStatsThread.run(SNMPStatsThread.java:35)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [StatsLoggerThread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
statistics.StatsLoggerThread._sleep(StatsLoggerThread.java:48)
statistics.StatsLoggerThread.run(StatsLoggerThread.java:31)


13-Dec-2015 17:12:37.623 WARNING [localhost-startStop-2]
org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [CVP] appears to have started a thread named [LoggerManagerWorker] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.lang.Object.wait(Native Method)
com.MyCom.server.util.BoundedLinkedQueue.poll(BoundedLinkedQueue.java:303)
com.MyCom.server.util.ThreadPool.getTask(ThreadPool.java:737)
com.MyCom.server.util.ThreadPool$Worker.run(ThreadPool.java:773)
java.lang.Thread.run(Thread.java:745)
13-Dec-2015 17:12:37.639 INFO [Thread-15] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-7000"]
13-Dec-2015 17:12:37.639 INFO [Thread-15] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-7443"]
13-Dec-2015 17:12:37.639 INFO [Thread-15] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-apr-7009"]

最佳答案

我在您的日志中看到了一些线程池。除非提供了一个创建守护线程的工厂,否则它们将默认创建非守护线程。在所有非守护线程都终止之前,JVM 不会终止。

所以我的猜测是 JVM 由未正确关闭的线程池保持 Activity 状态,而是在 GC 和最终确定时剔除它们的线程。

终结取决于 GC 压力。当您更改堆限制时,可能会降低 GC 的频率,从而延迟关闭。

当然,这是一个相当长的潜在原因链,所以这只不过是一个猜测。

关于java - 64 位升级后关闭 Tomcat JVM 服务的时间更长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34352225/

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