问题描述
老服务器中运行一个系统,tomcat没有任何问题,可是换到新买的服务器上,tomcat就出现了宕机的现象。通过JProfiler监控内存使用,开始发现heap大小合适,只是回收不及时,然后处理了一下回收,现在heap使用基本就在85m大小,没有泄露。catalina.bat中设置的是-Xms800m,-Xmx800m,-XX:NewSize=256m,-XX:MaxNewSize=256mheap设置了800m,现在只用了85m左右,没有再累加,并未出现泄露但是现在又宕机了,原因不明,把tomcat 的log放出来,希望童鞋们帮忙看一下,谢谢!## An unexpected error has been detected by Java Runtime Environment:## EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c95b583, pid=3308, tid=4044## Java VM: Java HotSpot(TM) Server VM (11.0-b15 mixed mode windows-x86)# Problematic frame:# C [ntdll.dll+0x2b583]## 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 (0x0570d800): JavaThread "http-80-2" daemon [_thread_in_native, id=4044, stack(0x09b30000,0x09b80000)]siginfo: ExceptionCode=0xc0000005, writing address 0x54455800Registers:EAX=0x0571a898, EBX=0x000004ee, ECX=0x54455800, EDX=0x20544547ESP=0x09b7ed70, EBP=0x09b7ed88, ESI=0x0571a890, EDI=0x00300000EIP=0x7c95b583, EFLAGS=0x00010287Top of Stack: (sp=0x09b7ed70)0x09b7ed70: 0571a890 0571a890 00300000 054700000x09b7ed80: 05470000 04c70000 09b7edd0 7c95ba810x09b7ed90: 000004ee 0071a890 000004ee 003000000x09b7eda0: 0571a890 00000000 00000000 0571d0000x09b7edb0: 09b7edcc 05470000 00000000 0571d0000x09b7edc0: 00000000 000000ee 00000000 000000000x09b7edd0: 09b7eeb4 7c95b646 0571b000 000020000x09b7ede0: 000004ee 000001bd 0571a898 00002000 Instructions: (pc=0x7c95b583)0x7c95b573: 00 00 8b d0 8b 4a 04 8d 46 08 89 10 89 48 04 560x7c95b583: 89 01 57 89 42 04 e8 37 f0 ff ff 89 5d 08 0f b7 Stack: [0x09b30000,0x09b80000], sp=0x09b7ed70, free space=315kNative frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)C [ntdll.dll+0x2b583]C [ntdll.dll+0x2ba81]C [ntdll.dll+0x2b646]C [msvcr71.dll+0x218a]C [net.dll+0x710e]j java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I+0j java.net.SocketInputStream.read([BII)I+119j org.apache.coyote.http11.InternalInputBuffer.fill()Z+59Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)j java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I+0j java.net.SocketInputStream.read([BII)I+119j org.apache.coyote.http11.InternalInputBuffer.fill()Z+59J org.apache.coyote.http11.InternalInputBuffer.parseRequestLine()Vj org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+234j org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82j org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+58j java.lang.Thread.run()V+11v ~StubRoutines::call_stub--------------- P R O C E S S ---------------Java Threads: ( => current thread ) 0x09334800 JavaThread "http-80-12" daemon [_thread_blocked, id=380, stack(0x0a370000,0x0a3c0000)] 0x04e15400 JavaThread "http-80-11" daemon [_thread_blocked, id=2896, stack(0x0a320000,0x0a370000)] 0x08b5e400 JavaThread "http-80-10" daemon [_thread_blocked, id=2884, stack(0x0a2d0000,0x0a320000)] 0x055be400 JavaThread "http-80-9" daemon [_thread_blocked, id=2876, stack(0x0a260000,0x0a2b0000)] 0x07b6f800 JavaThread "http-80-8" daemon [_thread_blocked, id=3620, stack(0x0a040000,0x0a090000)] 0x04d6ec00 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3992, stack(0x0a090000,0x0a0e0000)] 0x06e3dc00 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=4012, stack(0x09ff0000,0x0a040000)] 0x07fcf800 JavaThread "http-80-7" daemon [_thread_blocked, id=168, stack(0x09c20000,0x09c70000)] 0x06246400 JavaThread "http-80-6" daemon [_thread_blocked, id=3844, stack(0x09bd0000,0x09c20000)] 0x05495400 JavaThread "http-80-5" daemon [_thread_blocked, id=3968, stack(0x07980000,0x079d0000)] 0x0555b400 JavaThread "http-80-4" daemon [_thread_blocked, id=4072, stack(0x07930000,0x07980000)] 0x05507400 JavaThread "TP-Monitor" daemon [_thread_blocked, id=4024, stack(0x09e40000,0x09e90000)] 0x07e4ac00 JavaThread "TP-Processor4" daemon [_thread_in_native, id=4020, stack(0x09df0000,0x09e40000)] 0x05897800 JavaThread "TP-Processor3" daemon [_thread_blocked, id=4016, stack(0x09da0000,0x09df0000)] 0x05897400 JavaThread "TP-Processor2" daemon [_thread_blocked, id=4028, stack(0x09d50000,0x09da0000)] 0x07fcac00 JavaThread "TP-Processor1" daemon [_thread_blocked, id=4036, stack(0x09d00000,0x09d50000)] 0x07a8d400 JavaThread "http-80-3" daemon [_thread_in_native, id=4032, stack(0x09b80000,0x09bd0000)]=>0x0570d800 JavaThread "http-80-2" daemon [_thread_in_native, id=4044, stack(0x09b30000,0x09b80000)] 0x05a69c00 JavaThread "http-80-1" daemon [_thread_blocked, id=4040, stack(0x09ae0000,0x09b30000)] 0x080fec00 JavaThread "http-80-Acceptor-0" daemon [_thread_in_native, id=4048, stack(0x09a90000,0x09ae0000)] 0x06dd3c00 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=4056, stack(0x09a40000,0x09a90000)] 0x06e7dc00 JavaThread "Timer-1" [_thread_in_native, id=3680, stack(0x099f0000,0x09a40000)] 0x06a88400 JavaThread "Timer-0" [_thread_blocked, id=3316, stack(0x070e0000,0x07130000)] 0x04da3800 JavaThread "_jprofiler_sampler" daemon [_thread_blocked, id=3868, stack(0x05410000,0x05460000)] 0x04d3fc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3700, stack(0x05370000,0x053c0000)] 0x04d1a800 JavaThread "CompilerThread1" daemon [_thread_blocked, id=3692, stack(0x05320000,0x05370000)] 0x04d1a400 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3736, stack(0x052d0000,0x05320000)] 0x04a0f800 JavaThread "_jprofiler_native_sampler" daemon [_thread_in_native, id=3740, stack(0x05230000,0x05280000)] 0x049f9800 JavaThread "_jprofiler_native_comm" daemon [_thread_in_native, id=3712, stack(0x051a0000,0x051f0000)] 0x049d7800 JavaThread "Attach Listener" daemon [_thread_blocked, id=2880, stack(0x05150000,0x051a0000)] 0x049d6c00 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3752, stack(0x05100000,0x05150000)] 0x040aec00 JavaThread "Finalizer" daemon [_thread_blocked, id=3748, stack(0x04ab0000,0x04b00000)] 0x04989800 JavaThread "Reference Handler" daemon [_thread_blocked, id=3756, stack(0x04a60000,0x04ab0000)] 0x00307400 JavaThread "main" [_thread_in_native, id=2968, stack(0x00900000,0x00950000)]Other Threads: 0x040a3c00 VMThread [stack: 0x04a10000,0x04a60000] [id=3760] 0x04d1b400 WatcherThread [stack: 0x053c0000,0x05410000] [id=3704]VM state:not at safepoint (normal execution)VM Mutex/Monitor currently owned by a thread: NoneHeapPSYoungGen total 249472K, used 4778K [0x3a110000, 0x4a110000, 0x4a110000)eden space 235968K, 2% used [0x3a110000,0x3a5babb8,0x48780000)from space 13504K, 0% used [0x493e0000,0x493e0000,0x4a110000)to space 12672K, 0% used [0x48780000,0x48780000,0x493e0000)PSOldGen total 557056K, used 75307K [0x18110000, 0x3a110000, 0x3a110000)object space 557056K, 13% used [0x18110000,0x1ca9ae40,0x3a110000)PSPermGen total 65536K, used 35163K [0x10110000, 0x14110000, 0x18110000)object space 65536K, 53% used [0x10110000,0x12366e98,0x14110000)/******************************************/这里看各处内存都正常使用,并没有异常,但是还是宕机。Dynamic libraries:0x00400000 - 0x00424000 C:jdk6binjava.exe0x7c930000 - 0x7ca00000 C:WINDOWSsystem32ntdll.dll0x7c800000 - 0x7c92b000 C:WINDOWSsystem32kernel32.dll0x77f30000 - 0x77fdb000 C:WINDOWSsystem32ADVAPI32.dll0x77c20000 - 0x77cbf000 C:WINDOWSsystem32RPCRT4.dll0x76eb0000 - 0x76ec3000 C:WINDOWSsystem32Secur32.dll0x7c340000 - 0x7c396000 C:jdk6jrebinmsvcr71.dll0x6db30000 - 0x6def4000 C:jdk6jrebinserverjvm.dll0x77e10000 - 0x77ea0000 C:WINDOWSsystem32USER32.dll0x77bd0000 - 0x77c19000 C:WINDOWSsystem32GDI32.dll0x769e0000 - 0x76a0a000 C:WINDOWSsystem32WINMM.dll0x76180000 - 0x7619d000 C:WINDOWSsystem32IMM32.DLL0x7f000000 - 0x7f009000 C:WINDOWSsystem32LPK.DLL0x74ae0000 - 0x74b45000 C:WINDOWSsystem32USP10.dll0x71b20000 - 0x71b28000 C:WINDOWSsystem32rdpsnd.dll0x77f10000 - 0x77f21000 C:WINDOWSsystem32WINSTA.dll0x77b70000 - 0x77bca000 C:WINDOWSsystem32msvcrt.dll0x71ba0000 - 0x71bf7000 C:WINDOWSsystem32NETAPI32.dll0x76ab0000 - 0x76abb000 C:WINDOWSsystem32PSAPI.DLL0x6d330000 - 0x6d338000 C:jdk6jrebinhpi.dll0x10000000 - 0x10102000 C:PROGRA~1JPROFI~1binwindowsjprofilerti.dll0x71b10000 - 0x71b1b000 C:WINDOWSsystem32WSOCK32.dll0x71b60000 - 0x71b77000 C:WINDOWSsystem32WS2_32.dll0x71b50000 - 0x71b58000 C:WINDOWSsystem32WS2HELP.dll0x6d860000 - 0x6d86c000 C:jdk6jrebinverify.dll0x6d3d0000 - 0x6d3ef000 C:jdk6jrebinjava.dll0x6d8a0000 - 0x6d8af000 C:jdk6jrebinzip.dll0x71a80000 - 0x71ac0000 C:WINDOWSsystem32mswsock.dll0x69660000 - 0x696b7000 C:WINDOWSsystem32hnetcfg.dll0x71a40000 - 0x71a48000 C:WINDOWSSystem32wshtcpip.dll0x6d610000 - 0x6d619000 C:jdk6jrebinmanagement.dll0x6d6c0000 - 0x6d6d3000 C:jdk6jrebinnet.dll0x76e30000 - 0x76e5b000 C:WINDOWSsystem32DNSAPI.dll0x76ed0000 - 0x76ed7000 C:WINDOWSSystem32winrnr.dll0x76e70000 - 0x76e9e000 C:WINDOWSsystem32WLDAP32.dll0x76ee0000 - 0x76ee5000 C:WINDOWSsystem32rasadhlp.dll0x6d0b0000 - 0x6d1e8000 C:jdk6jrebinawt.dll0x72f40000 - 0x72f67000 C:WINDOWSsystem32WINSPOOL.DRV0x774b0000 - 0x775e9000 C:WINDOWSsystem32ole32.dll0x77370000 - 0x77407000 C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0comctl32.dll0x0a0e0000 - 0x0a150000 d:Program Files360360safesafemonsafemon.dll0x7ca10000 - 0x7d1ec000 C:WINDOWSsystem32SHELL32.dll0x77eb0000 - 0x77f02000 C:WINDOWSsystem32SHLWAPI.dll0x775f0000 - 0x7767b000 C:WINDOWSsystem32OLEAUT32.dll0x76170000 - 0x76175000 C:WINDOWSsystem32MSIMG32.dll0x0a160000 - 0x0a1c5000 C:WINDOWSsystem32MSVCP60.dll0x779e0000 - 0x77a87000 C:WINDOWSsystem32WININET.dll0x760a0000 - 0x76131000 C:WINDOWSsystem32CRYPT32.dll0x76080000 - 0x76092000 C:WINDOWSsystem32MSASN1.dll0x77b60000 - 0x77b68000 C:WINDOWSsystem32VERSION.dll0x77250000 - 0x772fe000 C:WINDOWSsystem32urlmon.dll0x77cd0000 - 0x77dd3000 C:WINDOWSWinSxSx86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55comctl32.dll0x74430000 - 0x74480000 C:WINDOWSsystem32MSCTF.dll0x75d60000 - 0x75d87000 C:WINDOWSsystem32apphelp.dll0x4c510000 - 0x4c53e000 C:WINDOWSsystem32msctfime.ime0x6d2d0000 - 0x6d324000 C:jdk6jrebinfontmanager.dll0x6d240000 - 0x6d263000 C:jdk6jrebindcpr.dll0x6d6e0000 - 0x6d6e9000 C:jdk6jrebinnio.dllVM Arguments:jvm_args: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=E:tomcat6conflogging.properties -Xms800m -Xmx800m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=64m -XX:MaxPermSize=128m -agentpath:C:PROGRA~1JPROFI~1binwindowsjprofilerti.dll=port=8849 -Djava.endorsed.dirs=E:tomcat6endorsed -Dcatalina.base=E:tomcat6 -Dcatalina.home=E:tomcat6 -Djava.io.tmpdir=E:tomcat6temp java_command: org.apache.catalina.startup.Bootstrap startLauncher Type: SUN_STANDARDEnvironment Variables:JAVA_HOME=C:jdk6JRE_HOME=C:jdk6CLASSPATH=C:jdk6libtools.jar;E:tomcat6binbootstrap.jarPATH=C:jdk6bin;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;c:jdk6bin..jrebinUSERNAME=AdministratorOS=Windows_NTPROCESSOR_IDENTIFIER=x86 Family 6 Model 29 Stepping 1, GenuineIntel--------------- S Y S T E M ---------------OS: Windows Server 2003 family Build 3790 Service Pack 2CPU:total 24 (8 cores per cpu, 1 threads per core) family 6 model 13 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)vm_info: Java HotSpot(TM) Server VM (11.0-b15) for windows-x86 JRE (1.6.0_10-rc2-b32), built on Sep 12 2008 00:47:31 by "java_re" with MS VC++ 7.1time: Fri Oct 22 11:24:09 2010elapsed time: 6040 seconds 问题补充:sandzhang 写道
解决方案
有解决问题,我们现在用的是6.0.26,非安装版
解决方案二:
可以看一下我的这篇文章。内存溢出的http://songfantasy.iteye.com/blog/791808
解决方案三:
换一个tomcat版本试试看吧,以前也碰到过,从这里看来,出问题的地方不象是你的代码Stack: [0x09b30000,0x09b80000], sp=0x09b7ed70, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x2b583] C [ntdll.dll+0x2ba81] C [ntdll.dll+0x2b646] C [msvcr71.dll+0x218a] C [net.dll+0x710e] j java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I+0 j java.net.SocketInputStream.read([BII)I+119 j org.apache.coyote.http11.InternalInputBuffer.fill()Z+59 Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j java.net.SocketInputStream.socketRead0(Ljava/io/FileDescriptor;[BIII)I+0 j java.net.SocketInputStream.read([BII)I+119 j org.apache.coyote.http11.InternalInputBuffer.fill()Z+59 J org.apache.coyote.http11.InternalInputBuffer.parseRequestLine()V j org.apache.coyote.http11.Http11Processor.process(Ljava/net/Socket;)V+234 j org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Ljava/net/Socket;)Z+82 j org.apache.tomcat.util.net.JIoEndpoint$Worker.run()V+58 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub