0

我的项目是用SpringMVC搭建的,Atmosphere实现数据的实时推送,本项目还集成了apache shiro做安全控制。

本项目运行在 Apache tomcat7.0.40,Windows Server 2008 R2 x64 16G 内存,jvm 版本为:java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64 -Bit Server VM (build 20.45-b01, 混合模式)

我的问题是:Tomcat 总是自动关机,而这种“自动关机”似乎是随机的。

任何人都可以帮助我确定路线原因吗?

web.xml 中的氛围配置:

<servlet>
    <servlet-name>meteorServlet</servlet-name>
    <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class>
    <init-param>
    <param-name>org.atmosphere.servlet</param-name>
        <param-value>org.springframework.web.servlet.DispatcherServlet</param-value>
    </init-param>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/config/**/*-servlet.xml</param-value>
    </init-param>
    <init-param>
        <param-name>org.atmosphere.cpr.AtmosphereInterceptor</param-name>
        <param-value>org.atmosphere.interceptor.HeartbeatInterceptor</param-value>
    </init-param>
    <init-param>
        <param-name>org.atmosphere.cpr.sessionSupport</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>org.atmosphere.filter.name</param-name>
        <param-value>shiroFilter</param-value>
    </init-param>
    <init-param>
        <param-name>org.atmosphere.websocket.messageContentType</param-name>
        <param-value>application/json</param-value>
    </init-param>
    <init-param>
        <param-name>filterMappingUrlPattern</param-name>
        <param-value>/*</param-value>
    </init-param>

    <load-on-startup>0</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>meteorServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

我在 web.xml 中的 Shiro 过滤器:

<filter>
    <filter-name>shiroFilter</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <init-param>
        <param-name>targetFilterLifecycle</param-name>
        <param-value>true</param-value>
    </init-param>
    <async-supported>true</async-supported>
</filter>

<filter-mapping>
    <filter-name>shiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

我使用Spring的定时任务每6秒向客户端推送一次数据,相关代码:

@Scheduled(cron = "0/6 * * * * *")
@Override
public void run() {
    try {
        if (isFetchAllData()) {
            List<T> allData = getAll();
            setMainCache(allData);
        } else {
            List<T> updatedData = getUpdated();
            setUpdatedCache(updatedData);
            pushData(updatedData);
        }
    } catch (Throwable e) {
        logger.error("Error", e);
        throw new ApplicationException(e);
    }
}

private synchronized void pushData(List<T> updatedData) {
    List<TaskUnit> toRemove = new ArrayList<TaskUnit>();
    for (TaskUnit taskUnit : taskUnits) {
        AtmosphereResource resource = taskUnit.getResource();
        Map<String, Object> queryParam = taskUnit.getQueryParam();
        List<T> filteredDataList = filterData(updatedData, queryParam);
        try {
            if (!resource.isResumed() && !resource.isCancelled() && ((AtmosphereResourceImpl)resource).isInScope()) {
                resource.getResponse().write(objectMapper.writeValueAsString(filteredDataList));
            } else {
                logger.debug("AtmosphereResource isResumed:" + resource.isResumed() + " isCancelled:" + resource.isCancelled() + " isInScope:"+ ((AtmosphereResourceImpl)resource).isInScope());
                toRemove.add(taskUnit);
            }
        } catch (IllegalStateException e1) {
            toRemove.add(taskUnit);
            logger.error("Remove task unit from taskunits list", e1);
        } catch (Throwable e) {
            logger.error("Write List to string failed!", e);
            throw new ApplicationException(e);
        }
    }
    taskUnits.removeAll(toRemove);
}

一段日志:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800057b2, pid=3200, tid=7536
#
# JRE version: 6.0_45-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20.45-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [tcnative-1.dll+0x57b2]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x0000000007b88000):  JavaThread "tmTaskScheduler-1" [_thread_in_native, id=7536, stack(0x000000000c610000,0x000000000c710000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000040

Stack: [0x000000000c610000,0x000000000c710000],  sp=0x000000000c70e280,  free space=1016k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [tcnative-1.dll+0x57b2]  Java_org_apache_tomcat_jni_Socket_sendbb+0x72

[error occurred during error reporting (printing native stack), id 0xc0000005]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.apache.tomcat.jni.Socket.sendbb(JII)I+0
j  org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer()V+22
J  org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(Lorg/apache/tomcat/util/buf/ByteChunk;Lorg/apache/coyote/Response;)I
J  org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(Lorg/apache/tomcat/util/buf/ByteChunk;Lorg/apache/coyote/Response;)I
j  org.apache.coyote.http11.AbstractOutputBuffer.doWrite(Lorg/apache/tomcat/util/buf/ByteChunk;Lorg/apache/coyote/Response;)I+49
j  org.apache.coyote.Response.doWrite(Lorg/apache/tomcat/util/buf/ByteChunk;)V+6
j  org.apache.catalina.connector.OutputBuffer.realWriteBytes([BII)V+38
j  org.apache.tomcat.util.buf.ByteChunk.flushBuffer()V+71
j  org.apache.tomcat.util.buf.ByteChunk.append([BII)V+159
j  org.apache.catalina.connector.OutputBuffer.writeBytes([BII)V+15
j  org.apache.catalina.connector.OutputBuffer.write([BII)V+12
j  org.apache.catalina.connector.CoyoteOutputStream.write([BII)V+7
j  org.apache.catalina.connector.CoyoteOutputStream.write([B)V+5
j  org.atmosphere.cpr.AtmosphereResponse.write([BZ)Lorg/atmosphere/cpr/AtmosphereResponse;+63
j  org.atmosphere.cpr.AtmosphereResponse.write([B)Lorg/atmosphere/cpr/AtmosphereResponse;+3
j  org.atmosphere.cpr.AtmosphereInterceptorWriter.writeReady(Lorg/atmosphere/cpr/AtmosphereResponse;[B)V+2
j  org.atmosphere.cpr.AtmosphereInterceptorWriter.invokeInterceptor(Lorg/atmosphere/cpr/AtmosphereResponse;[BII)V+113
j  org.atmosphere.cpr.AtmosphereInterceptorWriter.write(Lorg/atmosphere/cpr/AtmosphereResponse;[BII)Lorg/atmosphere/cpr/AsyncIOWriter;+6
j  org.atmosphere.cpr.AtmosphereInterceptorWriter.write(Lorg/atmosphere/cpr/AtmosphereResponse;[B)Lorg/atmosphere/cpr/AsyncIOWriter;+6
j  org.atmosphere.cpr.AtmosphereResponse$2.write([B)V+47
j  org.atmosphere.cpr.AtmosphereResponse.write(Ljava/lang/String;Z)Lorg/atmosphere/cpr/AtmosphereResponse;+70
j  org.atmosphere.cpr.AtmosphereResponse.write(Ljava/lang/String;)Lorg/atmosphere/cpr/AtmosphereResponse;+3
j  org.iosh.base.service.AbstractWebSocketService.pushData(Ljava/util/List;)V+76
j  org.iosh.base.service.AbstractWebSocketService.run()V+32
j  sun.reflect.GeneratedMethodAccessor127.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+36
J  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
j  org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+7
J  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;
j  org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation()Ljava/lang/Object;+4
j  org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(Ljava/lang/reflect/Method;Ljava/lang/Class;Lorg/springframework/transaction/interceptor/TransactionAspectSupport$InvocationCallback;)Ljava/lang/Object;+58
j  org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object;+40
J  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;
j  org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Lorg/aopalliance/intercept/MethodInvocation;)Ljava/lang/Object;+18
J  org.springframework.aop.framework.ReflectiveMethodInvocation.proceed()Ljava/lang/Object;
j  org.springframework.aop.framework.JdkDynamicAopProxy.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+322
j  com.sun.proxy.$Proxy85.run()V+9
j  sun.reflect.GeneratedMethodAccessor140.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+36
J  java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
j  org.springframework.scheduling.support.ScheduledMethodRunnable.run()V+19
j  org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run()V+4
j  org.springframework.scheduling.concurrent.ReschedulingRunnable.run()V+9
j  java.util.concurrent.Executors$RunnableAdapter.call()Ljava/lang/Object;+4
j  java.util.concurrent.FutureTask$Sync.innerRun()V+30
j  java.util.concurrent.FutureTask.run()V+4
j  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Ljava/util/concurrent/ScheduledThreadPoolExecutor$ScheduledFutureTask;)V+1
j  java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run()V+15
j  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Ljava/lang/Runnable;)V+66
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+33
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000000b0a6000 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2" daemon [_thread_in_native, id=7768, stack(0x000000000bfe0000,0x000000000c0e0000)]
  0x000000000b0a6800 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1" daemon [_thread_in_native, id=480, stack(0x000000000adb0000,0x000000000aeb0000)]
  0x000000000b0a1000 JavaThread "com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0" daemon [_thread_in_native, id=3612, stack(0x000000000ac90000,0x000000000ad90000)]
  0x0000000008f17800 JavaThread "http-apr-8081-exec-10" daemon [_thread_blocked, id=7316, stack(0x0000000011bd0000,0x0000000011cd0000)]
  0x000000000ab07000 JavaThread "http-apr-8081-exec-9" daemon [_thread_blocked, id=7668, stack(0x000000000c4a0000,0x000000000c5a0000)]
  0x000000000ab08000 JavaThread "http-apr-8081-exec-8" daemon [_thread_blocked, id=5396, stack(0x000000000c0e0000,0x000000000c1e0000)]
  0x0000000008f16800 JavaThread "http-apr-8081-exec-7" daemon [_thread_blocked, id=4344, stack(0x0000000011ad0000,0x0000000011bd0000)]
  0x0000000008f16000 JavaThread "http-apr-8081-exec-6" daemon [_thread_blocked, id=4328, stack(0x00000000119d0000,0x0000000011ad0000)]
  0x0000000008f15000 JavaThread "http-apr-8081-exec-5" daemon [_thread_blocked, id=6668, stack(0x00000000118d0000,0x00000000119d0000)]
  0x0000000008f14800 JavaThread "http-apr-8081-exec-4" daemon [_thread_blocked, id=8108, stack(0x00000000117d0000,0x00000000118d0000)]
  0x0000000008f13800 JavaThread "http-apr-8081-exec-3" daemon [_thread_blocked, id=7648, stack(0x000000000c1e0000,0x000000000c2e0000)]
  0x0000000008f13000 JavaThread "http-apr-8081-exec-2" daemon [_thread_blocked, id=8072, stack(0x0000000009ab0000,0x0000000009bb0000)]
  0x0000000008f12800 JavaThread "http-apr-8081-exec-1" daemon [_thread_blocked, id=8044, stack(0x00000000099b0000,0x0000000009ab0000)]
  0x0000000008f11000 JavaThread "ajp-apr-8009-AsyncTimeout" daemon [_thread_blocked, id=7364, stack(0x00000000116d0000,0x00000000117d0000)]
  0x0000000008f10000 JavaThread "ajp-apr-8009-Acceptor-0" daemon [_thread_in_native, id=7460, stack(0x00000000115d0000,0x00000000116d0000)]
  0x0000000008f0f800 JavaThread "ajp-apr-8009-CometPoller-7" daemon [_thread_blocked, id=2280, stack(0x00000000114d0000,0x00000000115d0000)]
  0x0000000008f0e800 JavaThread "ajp-apr-8009-CometPoller-6" daemon [_thread_blocked, id=7068, stack(0x00000000113d0000,0x00000000114d0000)]
  0x0000000008f0e000 JavaThread "ajp-apr-8009-CometPoller-5" daemon [_thread_blocked, id=8008, stack(0x00000000112d0000,0x00000000113d0000)]
  0x0000000008f0d000 JavaThread "ajp-apr-8009-CometPoller-4" daemon [_thread_blocked, id=7128, stack(0x00000000111d0000,0x00000000112d0000)]
  0x0000000008f0c800 JavaThread "ajp-apr-8009-CometPoller-3" daemon [_thread_blocked, id=8124, stack(0x00000000110d0000,0x00000000111d0000)]
  0x0000000008f0c000 JavaThread "ajp-apr-8009-CometPoller-2" daemon [_thread_blocked, id=3648, stack(0x0000000010fd0000,0x00000000110d0000)]
  0x000000000856c000 JavaThread "ajp-apr-8009-CometPoller-1" daemon [_thread_blocked, id=7660, stack(0x0000000010ed0000,0x0000000010fd0000)]
  0x000000000856b800 JavaThread "ajp-apr-8009-CometPoller-0" daemon [_thread_blocked, id=6624, stack(0x0000000010dd0000,0x0000000010ed0000)]
  0x000000000856a800 JavaThread "ajp-apr-8009-Poller-7" daemon [_thread_blocked, id=8056, stack(0x0000000010cd0000,0x0000000010dd0000)]
  0x000000000856a000 JavaThread "ajp-apr-8009-Poller-6" daemon [_thread_blocked, id=8132, stack(0x0000000010bd0000,0x0000000010cd0000)]
  0x0000000008569800 JavaThread "ajp-apr-8009-Poller-5" daemon [_thread_blocked, id=7476, stack(0x0000000010ad0000,0x0000000010bd0000)]
  0x0000000008568800 JavaThread "ajp-apr-8009-Poller-4" daemon [_thread_blocked, id=7976, stack(0x00000000109d0000,0x0000000010ad0000)]
  0x0000000008568000 JavaThread "ajp-apr-8009-Poller-3" daemon [_thread_blocked, id=7392, stack(0x00000000108d0000,0x00000000109d0000)]
  0x0000000008567000 JavaThread "ajp-apr-8009-Poller-2" daemon [_thread_blocked, id=7844, stack(0x00000000107d0000,0x00000000108d0000)]
  0x0000000008566800 JavaThread "ajp-apr-8009-Poller-1" daemon [_thread_blocked, id=6156, stack(0x00000000106d0000,0x00000000107d0000)]
  0x0000000008565800 JavaThread "ajp-apr-8009-Poller-0" daemon [_thread_blocked, id=7028, stack(0x00000000105d0000,0x00000000106d0000)]
  0x0000000008565000 JavaThread "http-apr-8081-AsyncTimeout" daemon [_thread_blocked, id=7892, stack(0x00000000104d0000,0x00000000105d0000)]
  0x0000000008fe2000 JavaThread "http-apr-8081-Acceptor-0" daemon [_thread_in_native, id=7840, stack(0x00000000103d0000,0x00000000104d0000)]
  0x0000000008fe1000 JavaThread "http-apr-8081-Sendfile-0" daemon [_thread_blocked, id=5184, stack(0x00000000102d0000,0x00000000103d0000)]
  0x0000000008fe0800 JavaThread "http-apr-8081-CometPoller-7" daemon [_thread_blocked, id=7528, stack(0x00000000101d0000,0x00000000102d0000)]
  0x0000000008fdf800 JavaThread "http-apr-8081-CometPoller-6" daemon [_thread_blocked, id=6872, stack(0x00000000100d0000,0x00000000101d0000)]
  0x0000000008fdf000 JavaThread "http-apr-8081-CometPoller-5" daemon [_thread_blocked, id=7928, stack(0x000000000ffd0000,0x00000000100d0000)]
  0x0000000008fde000 JavaThread "http-apr-8081-CometPoller-4" daemon [_thread_blocked, id=1672, stack(0x000000000fed0000,0x000000000ffd0000)]
  0x0000000008fdd800 JavaThread "http-apr-8081-CometPoller-3" daemon [_thread_blocked, id=7908, stack(0x000000000fdd0000,0x000000000fed0000)]
  0x0000000008fdc800 JavaThread "http-apr-8081-CometPoller-2" daemon [_thread_blocked, id=6804, stack(0x000000000fcd0000,0x000000000fdd0000)]
  0x0000000008fdc000 JavaThread "http-apr-8081-CometPoller-1" daemon [_thread_blocked, id=844, stack(0x000000000fbd0000,0x000000000fcd0000)]
  0x0000000008fdb800 JavaThread "http-apr-8081-CometPoller-0" daemon [_thread_blocked, id=7416, stack(0x000000000eaf0000,0x000000000ebf0000)]
  0x0000000008fda800 JavaThread "http-apr-8081-Poller-7" daemon [_thread_in_native, id=8168, stack(0x000000000e9f0000,0x000000000eaf0000)]
  0x000000000ab0f000 JavaThread "http-apr-8081-Poller-6" daemon [_thread_blocked, id=3040, stack(0x000000000e8f0000,0x000000000e9f0000)]
  0x000000000ab0e800 JavaThread "http-apr-8081-Poller-5" daemon [_thread_blocked, id=7292, stack(0x000000000e7f0000,0x000000000e8f0000)]
  0x000000000ab0d800 JavaThread "http-apr-8081-Poller-4" daemon [_thread_in_native, id=2216, stack(0x000000000e6f0000,0x000000000e7f0000)]
  0x000000000ab0d000 JavaThread "http-apr-8081-Poller-3" daemon [_thread_in_native, id=7868, stack(0x000000000e5f0000,0x000000000e6f0000)]
  0x000000000ab0c000 JavaThread "http-apr-8081-Poller-2" daemon [_thread_in_native, id=6832, stack(0x000000000e4f0000,0x000000000e5f0000)]
  0x000000000ab0b800 JavaThread "http-apr-8081-Poller-1" daemon [_thread_blocked, id=1392, stack(0x000000000d410000,0x000000000d510000)]
  0x000000000ab0a800 JavaThread "http-apr-8081-Poller-0" daemon [_thread_in_native, id=5268, stack(0x000000000d310000,0x000000000d410000)]
  0x000000000ab0a000 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=7912, stack(0x000000000d210000,0x000000000d310000)]
  0x000000000ab06800 JavaThread "FileWatchdog" daemon [_thread_blocked, id=7904, stack(0x000000000c3a0000,0x000000000c4a0000)]
  0x000000000ab05800 JavaThread "tmTaskScheduler-12" [_thread_blocked, id=7272, stack(0x000000000d110000,0x000000000d210000)]
  0x000000000ab05000 JavaThread "tmTaskScheduler-11" [_thread_blocked, id=5936, stack(0x000000000d010000,0x000000000d110000)]
  0x000000000ab04000 JavaThread "tmTaskScheduler-10" [_thread_blocked, id=4620, stack(0x000000000cf10000,0x000000000d010000)]
  0x000000000ab03800 JavaThread "tmTaskScheduler-9" [_thread_blocked, id=7436, stack(0x000000000ce10000,0x000000000cf10000)]
  0x000000000ab03000 JavaThread "tmTaskScheduler-8" [_thread_blocked, id=8084, stack(0x000000000cd10000,0x000000000ce10000)]
  0x000000000ab02000 JavaThread "tmTaskScheduler-7" [_thread_blocked, id=5752, stack(0x000000000cc10000,0x000000000cd10000)]
  0x000000000ab01800 JavaThread "tmTaskScheduler-6" [_thread_blocked, id=4960, stack(0x000000000cb10000,0x000000000cc10000)]
  0x000000000ab00800 JavaThread "tmTaskScheduler-5" [_thread_blocked, id=7144, stack(0x000000000ca10000,0x000000000cb10000)]
  0x000000000ab00000 JavaThread "tmTaskScheduler-4" [_thread_in_native, id=4524, stack(0x000000000c910000,0x000000000ca10000)]
  0x0000000008d13800 JavaThread "tmTaskScheduler-3" [_thread_blocked, id=7800, stack(0x000000000c810000,0x000000000c910000)]
  0x0000000008ab9800 JavaThread "tmTaskScheduler-2" [_thread_blocked, id=7532, stack(0x000000000c710000,0x000000000c810000)]
=>0x0000000007b88000 JavaThread "tmTaskScheduler-1" [_thread_in_native, id=7536, stack(0x000000000c610000,0x000000000c710000)]
  0x000000000851b800 JavaThread "Timer-0" daemon [_thread_blocked, id=7716, stack(0x0000000009bb0000,0x0000000009cb0000)]
  0x0000000007998000 JavaThread "GC Daemon" daemon [_thread_blocked, id=8088, stack(0x0000000009760000,0x0000000009860000)]
  0x00000000070bd800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=7880, stack(0x0000000007650000,0x0000000007750000)]
  0x00000000070b2000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=4276, stack(0x0000000007550000,0x0000000007650000)]
  0x00000000070ad000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=7212, stack(0x0000000007450000,0x0000000007550000)]
  0x00000000070aa800 JavaThread "Attach Listener" daemon [_thread_blocked, id=7232, stack(0x0000000007350000,0x0000000007450000)]
  0x00000000070a5800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7508, stack(0x0000000007250000,0x0000000007350000)]
  0x0000000000527000 JavaThread "Finalizer" daemon [_thread_blocked, id=6768, stack(0x0000000006f50000,0x0000000007050000)]
  0x0000000000524800 JavaThread "Reference Handler" daemon [_thread_blocked, id=6252, stack(0x0000000006e50000,0x0000000006f50000)]
  0x000000000055b800 JavaThread "main" [_thread_in_native, id=4396, stack(0x00000000024b0000,0x00000000025b0000)]

Other Threads:
  0x000000000051d800 VMThread [stack: 0x0000000006d50000,0x0000000006e50000] [id=6956]
  0x00000000070ce800 WatcherThread [stack: 0x0000000007750000,0x0000000007850000] [id=3716]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 PSYoungGen      total 71296K, used 40645K [0x00000007aab60000, 0x00000007afa70000, 0x0000000800000000)
  eden space 70336K, 56% used [0x00000007aab60000,0x00000007ad2294b0,0x00000007af010000)
  from space 960K, 96% used [0x00000007af1e0000,0x00000007af2c8000,0x00000007af2d0000)
  to   space 5312K, 0% used [0x00000007af540000,0x00000007af540000,0x00000007afa70000)
 PSOldGen        total 174656K, used 68580K [0x0000000700200000, 0x000000070ac90000, 0x00000007aab60000)
  object space 174656K, 39% used [0x0000000700200000,0x00000007044f9208,0x000000070ac90000)
 PSPermGen       total 71360K, used 71250K [0x00000006fb000000, 0x00000006ff5b0000, 0x0000000700200000)
  object space 71360K, 99% used [0x00000006fb000000,0x00000006ff5949d0,0x00000006ff5b0000)

Code Cache  [0x00000000025b0000, 0x0000000002d10000, 0x00000000055b0000)
 total_blobs=2370 nmethods=1878 adapters=444 free_code_cache=42726464 largest_free_block=8064

VM Arguments:
jvm_args: -Djava.util.logging.config.file=C:\Tomcat81\conf\logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=C:\Tomcat81\endorsed -Dcatalina.base=C:\Tomcat81 -Dcatalina.home=C:\Tomcat81 -Djava.io.tmpdir=C:\Tomcat81\temp 
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Java\jdk1.6.0_45
JRE_HOME=C:\Java\jdk1.6.0_45
CLASSPATH=C:\Tomcat81\bin\bootstrap.jar;C:\Tomcat81\bin\tomcat-juli.jar
PATH=C:\Perl64\site\bin;C:\Perl64\bin;C:\Oracle\db11g\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Java\jdk1.6.0_45\bin
USERNAME=Administrator
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 44 Stepping 2, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows NT 6.1 , 64 bit Build 7601 Service Pack 1

CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 44 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt

Memory: 4k page, physical 16763996k(11271648k free), swap 33526148k(24216276k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (20.45-b01) for windows-amd64 JRE (1.6.0_45-b06), built on Apr  1 2013 12:31:37 by "java_re" with MS VC++ 8.0 (VS2005)

time: Wed Sep 11 15:19:00 2013
elapsed time: 20345 seconds
4

1 回答 1

0

从您的日志中很少观察到: 1. 您的许多守护程序线程处于阻塞状态。2.调度线程除了两个之外都被阻塞了,这意味着你的两个线程正在持有一些锁或者可能处于死锁状态,其余的都在等待锁。3. 你的 cron 作业每 6 秒运行一次,尝试在 private synchronized void pushData(List updatedData) 中找出线程所用的时间。这应该花费超过 6 秒的时间,因此许多线程正在等待获取锁,这从多个处于阻塞状态的调度程序线程可以看出。

请提供详细的线程堆栈,以便识别正在等待的线程。

还可以尝试根据执行一项任务所花费的时间增加您的 cron 频率,然后查看您的 tomcat 是否会自动终止。

于 2013-09-17T07:15:42.460 回答