我正在使用 JDK1.5 运行应用程序,在完整的 gc 运行期间,JVM 崩溃并且应用程序终止。我试图找到答案并搜索所有博客,但无济于事。请在这个问题上提供帮助。
以下是我的 JVM 配置。
$JAVA -server -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=55555 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Xms200m -Xmx200m -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:/tmp/gc.log -cp $CLASSPATH org.jpos.q2.Q2 $* -d $DEPLOYDIR
下面是 gc.log 的最后一部分,直到它在 full GC 期间终止。
781871.288: [GC [PSYoungGen: 2112K->64K(2304K)] 10821K->8773K(13504K), 0.0008360 secs]
781883.248: [GC [PSYoungGen: 2112K->96K(2304K)] 10821K->8805K(13504K), 0.0007630 secs]
781895.307: [GC [PSYoungGen: 2144K->128K(2304K)] 10853K->8837K(13504K), 0.0006810 secs]
781907.313: [GC [PSYoungGen: 2176K->128K(2304K)] 10885K->8837K(13504K), 0.0007420 secs]
781918.598: [GC [PSYoungGen: 2176K->160K(2304K)] 10885K->8869K(13504K), 0.0006410 secs]
781918.755: [GC [PSYoungGen: 2208K->224K(2304K)] 12837K->10869K(13504K), 0.0007600 secs]
781919.345: [GC [PSYoungGen: 2272K->320K(2368K)] 12917K->11032K(13568K), 0.0008320 secs]
781922.512: [GC [PSYoungGen: 2344K->353K(2368K)] 13056K->11139K(13568K), 0.0011440 secs]
781926.274: [GC [PSYoungGen: 2337K->416K(2432K)] 13123K->11978K(14464K), 0.0012700 secs]
781926.275: [Full GC [PSYoungGen: 416K->0K(2432K)] [PSOldGen: 11562K->8899K(11776K)] 11978K->8899K(14208K) [PSPermGen: 24042K->23972K(24064K)], 0.0793210 secs]
781935.368: [GC [PSYoungGen: 1984K->96K(2688K)] 10883K->8995K(14464K), 0.0008100 secs]
781947.380: [GC [PSYoungGen: 2080K->183K(2752K)] 10979K->9082K(14528K), 0.0006650 secs]
781959.390: [GC [PSYoungGen: 2167K->96K(2624K)] 11066K->8995K(14400K), 0.0007680 secs]
781971.064: [GC [PSYoungGen: 2080K->160K(2688K)] 10979K->9059K(14464K), 0.0007760 secs]
781971.424: [GC [PSYoungGen: 2144K->259K(2560K)] 11043K->9158K(14336K), 0.0009450 secs]
781983.433: [GC [PSYoungGen: 2243K->259K(2624K)] 11142K->9158K(14400K), 0.0007780 secs]
781993.612: [GC [PSYoungGen: 2243K->192K(2496K)] 11142K->9130K(14272K), 0.0009680 secs]
781995.461: [GC [PSYoungGen: 2176K->323K(2560K)] 11114K->9286K(14336K), 0.0008130 secs]
782007.473: [GC [PSYoungGen: 2307K->227K(2560K)] 11270K->9266K(14336K), 0.0008820 secs]
782018.965: [GC [PSYoungGen: 2211K->96K(2560K)] 11250K->9223K(14336K), 0.0014000 secs]
782019.160: [GC [PSYoungGen: 1686K->192K(2432K)] 10813K->9359K(14208K), 0.0007610 secs]
782023.473: [GC [PSYoungGen: 2176K->160K(2496K)] 11343K->10191K(14272K), 0.0008520 secs]
782031.512: [GC [PSYoungGen: 2144K->128K(2496K)] 12175K->10246K(14272K), 0.0007880 secs]
782043.523: [GC [PSYoungGen: 2112K->64K(2496K)] 12230K->10214K(14272K), 0.0007840 secs]
782055.490: [GC [PSYoungGen: 2048K->160K(2496K)] 12198K->10310K(14272K), 0.0006450 secs]
782067.496: [GC [PSYoungGen: 2144K->64K(2048K)] 12294K->10246K(13824K), 0.0006570 secs]
782075.577: [GC [PSYoungGen: 2048K->64K(2432K)] 12230K->10254K(14208K), 0.0007760 secs]
782087.591: [GC [PSYoungGen: 2048K->64K(2432K)] 12238K->10254K(14208K), 0.0009330 secs]
782099.604: [GC [PSYoungGen: 2048K->32K(2432K)] 12238K->10222K(14208K), 0.0008650 secs]
782107.616: [GC [PSYoungGen: 2016K->304K(2432K)] 12206K->10495K(14208K), 0.0008760 secs]
782110.893: [GC [PSYoungGen: 2288K->176K(2368K)] 12479K->10367K(14144K), 0.0009830 secs]
782112.649: [GC [PSYoungGen: 2160K->288K(2432K)] 12351K->11246K(14208K), 0.0008730 secs]
782112.649: [Full GC [PSYoungGen: 288K->0K(2432K)] [PSOldGen: 10958K->9293K(12352K)] 11246K->9293K(14784K) [PSPermGen: 23990K->23990K(24064K)], 0.0742820 secs]
782123.637: [GC [PSYoungGen: 1984K->32K(2368K)] 11277K->9325K(14720K), 0.0010350 secs]
782135.653: [GC [PSYoungGen: 2016K->64K(2432K)] 11309K->9357K(14784K), 0.0006410 secs]
782147.664: [GC [PSYoungGen: 2048K->64K(2432K)] 11341K->9357K(14784K), 0.0007670 secs]
782159.671: [GC [PSYoungGen: 2048K->64K(2432K)] 11341K->9357K(14784K), 0.0008380 secs]
782171.684: [GC [PSYoungGen: 2048K->64K(2432K)] 11341K->9357K(14784K), 0.0007230 secs]
782183.655: [GC [PSYoungGen: 2048K->64K(2048K)] 11341K->9357K(14400K), 0.0006930 secs]
782195.712: [GC [PSYoungGen: 2048K->64K(2368K)] 11341K->9357K(14720K), 0.0007440 secs]
782205.358: [GC [PSYoungGen: 2048K->64K(2368K)] 11341K->9357K(14720K), 0.0007200 secs]
782215.760: [GC [PSYoungGen: 2048K->64K(2368K)] 11341K->9357K(14720K), 0.0006480 secs]
782227.776: [GC [PSYoungGen: 2048K->64K(2048K)] 11341K->9357K(14400K), 0.0006730 secs]
782239.736: [GC [PSYoungGen: 2048K->96K(2304K)] 11341K->9389K(14656K), 0.0008810 secs]
782251.795: [GC [PSYoungGen: 2080K->128K(2304K)] 11373K->9421K(14656K), 0.0007560 secs]
782262.947: [GC [PSYoungGen: 2112K->128K(2304K)] 11405K->9421K(14656K), 0.0006640 secs]
782271.840: [GC [PSYoungGen: 2112K->160K(2304K)] 11405K->9453K(14656K), 0.0006750 secs]
782283.855: [GC [PSYoungGen: 2144K->160K(2304K)] 11437K->9453K(14656K), 0.0007630 secs]
782295.866: [GC [PSYoungGen: 2144K->160K(2304K)] 11437K->9453K(14656K), 0.0007420 secs]
782307.880: [GC [PSYoungGen: 2144K->128K(2304K)] 11437K->9421K(14656K), 0.0008340 secs]
782319.895: [GC [PSYoungGen: 2112K->128K(2304K)] 11405K->9421K(14656K), 0.0008680 secs]
782331.885: [GC [PSYoungGen: 2112K->96K(2368K)] 11405K->9389K(14720K), 0.0008060 secs]
782343.920: [GC [PSYoungGen: 2208K->160K(2368K)] 11501K->9453K(14720K), 0.0007720 secs]
782355.936: [GC [PSYoungGen: 2272K->96K(2368K)] 11565K->9389K(14720K), 0.0009360 secs]
782367.952: [GC [PSYoungGen: 2208K->128K(2368K)] 11501K->9421K(14720K), 0.0008270 secs]
782379.982: [GC [PSYoungGen: 2240K->96K(2368K)] 11533K->9389K(14720K), 0.0009960 secs]
782391.997: [GC [PSYoungGen: 2208K->128K(2368K)] 11501K->9421K(14720K), 0.0007990 secs]
782404.016: [GC [PSYoungGen: 2240K->128K(2368K)] 11533K->9421K(14720K), 0.0007950 secs]
782416.021: [GC [PSYoungGen: 2240K->128K(2368K)] 11533K->9445K(14720K), 0.0007770 secs]
782428.037: [GC [PSYoungGen: 2240K->128K(2368K)] 11557K->9445K(14720K), 0.0007330 secs]
782440.060: [GC [PSYoungGen: 2240K->96K(2368K)] 11557K->9413K(14720K), 0.0007770 secs]
782452.080: [GC [PSYoungGen: 2208K->128K(2432K)] 11525K->9445K(14784K), 0.0007520 secs]
782464.099: [GC [PSYoungGen: 2304K->96K(2368K)] 11621K->9413K(14720K), 0.0008620 secs]
782476.120: [GC [PSYoungGen: 2272K->96K(2368K)] 11589K->9413K(14720K), 0.0008520 secs]
782490.779: [GC [PSYoungGen: 2272K->192K(2368K)] 11589K->9509K(14720K), 0.0006790 secs]
782500.125: [GC [PSYoungGen: 2368K->224K(2432K)] 11685K->9541K(14784K), 0.0009220 secs]
782512.153: [GC [PSYoungGen: 2400K->224K(2432K)] 11717K->9541K(14784K), 0.0008990 secs]
782524.172: [GC [PSYoungGen: 2400K->224K(2496K)] 11717K->9541K(14848K), 0.0009810 secs]
782536.195: [GC [PSYoungGen: 2400K->224K(2496K)] 11717K->9541K(14848K), 0.0008980 secs]
782548.215: [GC [PSYoungGen: 2400K->224K(2496K)] 11717K->9541K(14848K), 0.0007980 secs]
782559.372: [GC [PSYoungGen: 2249K->288K(2496K)] 11566K->9669K(14848K), 0.0007870 secs]
782559.720: [GC [PSYoungGen: 2464K->352K(2496K)] 13765K->11725K(14848K), 0.0008590 secs]
782560.883: [GC [PSYoungGen: 2464K->419K(2560K)] 13837K->11885K(14912K), 0.0009040 secs]
782575.903: [GC [PSYoungGen: 2531K->483K(2624K)] 13997K->11949K(14976K), 0.0010410 secs]
782585.920: [GC [PSYoungGen: 2531K->419K(2688K)] 13997K->11885K(15040K), 0.0016260 secs]
782596.276: [GC [PSYoungGen: 2467K->320K(2688K)] 13933K->11929K(15040K), 0.0008940 secs]
782608.291: [GC [PSYoungGen: 2368K->320K(2432K)] 13977K->11929K(14784K), 0.0007790 secs]
782620.307: [GC [PSYoungGen: 2368K->256K(2624K)] 13977K->11865K(14976K), 0.0010760 secs]
782632.318: [GC [PSYoungGen: 2304K->288K(2624K)] 13913K->11897K(14976K), 0.0011900 secs]
782644.333: [GC [PSYoungGen: 2336K->256K(2496K)] 13945K->11865K(14848K), 0.0009720 secs]
782656.348: [GC [PSYoungGen: 2304K->288K(2560K)] 13913K->11897K(14912K), 0.0008570 secs]
782668.362: [GC [PSYoungGen: 2336K->256K(2560K)] 13945K->11865K(14912K), 0.0008460 secs]
782680.382: [GC [PSYoungGen: 2304K->256K(2560K)] 13913K->11865K(14912K), 0.0008630 secs]
782692.397: [GC [PSYoungGen: 2304K->288K(2432K)] 13913K->11897K(14784K), 0.0010490 secs]
782704.412: [GC [PSYoungGen: 2336K->320K(2496K)] 13945K->11929K(14848K), 0.0007630 secs]
782716.390: [GC [PSYoungGen: 2368K->224K(2496K)] 13977K->11897K(14848K), 0.0008310 secs]
782728.394: [GC [PSYoungGen: 2272K->192K(2496K)] 13945K->11913K(14848K), 0.0009370 secs]
782740.448: [GC [PSYoungGen: 2240K->160K(2496K)] 13961K->12001K(14848K), 0.0007460 secs]
782752.456: [GC [PSYoungGen: 2208K->64K(2496K)] 14049K->11905K(14848K), 0.0011290 secs]
782764.461: [GC [PSYoungGen: 2112K->96K(2560K)] 13953K->11937K(14912K), 0.0007870 secs]
782773.051: [GC [PSYoungGen: 2143K->64K(2560K)] 13985K->11921K(14912K), 0.0011620 secs]
782784.530: [GC [PSYoungGen: 2112K->128K(2432K)] 13969K->11985K(14784K), 0.0007680 secs]
782796.553: [GC [PSYoungGen: 2176K->96K(2496K)] 14033K->11953K(14848K), 0.0007890 secs]
782808.567: [GC [PSYoungGen: 2144K->128K(2496K)] 14001K->11985K(14848K), 0.0006670 secs]
782820.583: [GC [PSYoungGen: 2176K->96K(2496K)] 14033K->11953K(14848K), 0.0007790 secs]
782832.595: [GC [PSYoungGen: 2144K->128K(2496K)] 14001K->11985K(14848K), 0.0006820 secs]
782844.611: [GC [PSYoungGen: 2176K->96K(2496K)] 14033K->11953K(14848K), 0.0007800 secs]
782856.630: [GC [PSYoungGen: 2144K->128K(2368K)] 14001K->11985K(14720K), 0.0007110 secs]
782868.645: [GC [PSYoungGen: 2176K->96K(2432K)] 14033K->11953K(14784K), 0.0007570 secs]
782880.660: [GC [PSYoungGen: 2144K->96K(2432K)] 14001K->11953K(14784K), 0.0007800 secs]
782892.668: [GC [PSYoungGen: 2144K->96K(2432K)] 14001K->11953K(14784K), 0.0008600 secs]
782904.681: [GC [PSYoungGen: 2144K->128K(2432K)] 14001K->11985K(14784K), 0.0006960 secs]
782916.706: [GC [PSYoungGen: 2176K->96K(2176K)] 14033K->11953K(14528K), 0.0008780 secs]
782928.720: [GC [PSYoungGen: 2144K->128K(2368K)] 14001K->11985K(14720K), 0.0007100 secs]
782940.733: [GC [PSYoungGen: 2176K->128K(2368K)] 14033K->11985K(14720K), 0.0006950 secs]
782952.746: [GC [PSYoungGen: 2176K->96K(2368K)] 14033K->11969K(14720K), 0.0008680 secs]
782961.450: [GC [PSYoungGen: 2144K->128K(2368K)] 14017K->12017K(14720K), 0.0007920 secs]
782972.796: [GC [PSYoungGen: 2176K->96K(2368K)] 14065K->11985K(14720K), 0.0008230 secs]
782988.776: [GC [PSYoungGen: 2208K->96K(2368K)] 14097K->11985K(14720K), 0.0007900 secs]
783000.782: [GC [PSYoungGen: 2208K->96K(2368K)] 14097K->11985K(14720K), 0.0007880 secs]
783012.787: [GC [PSYoungGen: 2208K->64K(2368K)] 14097K->11953K(14720K), 0.0011260 secs]
783024.795: [GC [PSYoungGen: 2176K->96K(2368K)] 14065K->11985K(14720K), 0.0007960 secs]
783036.856: [GC [PSYoungGen: 2208K->64K(2368K)] 14097K->11953K(14720K), 0.0011490 secs]
783048.881: [GC [PSYoungGen: 2176K->160K(2368K)] 14065K->12057K(14720K), 0.0007650 secs]
783060.896: [GC [PSYoungGen: 2272K->128K(2368K)] 14169K->12025K(14720K), 0.0006980 secs]
783072.913: [GC [PSYoungGen: 2240K->96K(2368K)] 14137K->11993K(14720K), 0.0007010 secs]
783084.934: [GC [PSYoungGen: 2208K->64K(2368K)] 14105K->11961K(14720K), 0.0011290 secs]
783096.954: [GC [PSYoungGen: 2176K->128K(2368K)] 14073K->12025K(14720K), 0.0008070 secs]
783108.971: [GC [PSYoungGen: 2240K->64K(2368K)] 14137K->11961K(14720K), 0.0015050 secs]
783120.988: [GC [PSYoungGen: 2176K->96K(2368K)] 14073K->11993K(14720K), 0.0008080 secs]
783133.004: [GC [PSYoungGen: 2208K->96K(2368K)] 14105K->11993K(14720K), 0.0008700 secs]
783145.012: [GC [PSYoungGen: 2208K->160K(2368K)] 14105K->12081K(14720K), 0.0007960 secs]
783157.035: [GC [PSYoungGen: 2272K->96K(2368K)] 14193K->12017K(14720K), 0.0011550 secs]
783169.051: [GC [PSYoungGen: 2208K->128K(2368K)] 14129K->12049K(14720K), 0.0008070 secs]
783171.978: [GC [PSYoungGen: 2240K->227K(2368K)] 14161K->12201K(14720K), 0.0010940 secs]
783171.981: [GC [PSYoungGen: 2339K->227K(2816K)] 14313K->18089K(20928K), 0.0036700 secs]
783171.984: [Full GC
下面是我遇到的hs_err_pid22926
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0x0000002a95aa0a8c, pid=22926, tid=1084606816
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# V [libjvm.so+0x51ca8c]
#
--------------- T H R E A D ---------------
Current thread (0x0000002aebf9a230): VMThread [id=22935]
siginfo:si_signo=11, si_errno=0, si_code=128, si_addr=0x0000000000000000
Top of Stack: (sp=0x0000000040a5b800)
Instructions: (pc=0x0000002a95aa0a8c)
0x0000002a95aa0a7c: 48 8b 34 c7 48 8b 4e 08 48 8b 51 10 48 8d 79 10
0x0000002a95aa0a8c: ff 92 b0 00 00 00 48 8b 13 8b 02 85 c0 75 d5 eb
Stack: [0x000000004095c000,0x0000000040a5d000), sp=0x0000000040a5b800, free space=1022k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
VM_Operation (0x0000000043181e80): parallel gc failed allocation, mode: safepoint, requested by thread 0x0000002af3225d20
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x0000002af3c1b360 JavaThread "RMI TCP Connection(396)-190.252.10.99" daemon [_thread_blocked, id=29055]
0x0000002af4e1d6a0 JavaThread "JMX server connection timeout 7033" daemon [_thread_blocked, id=5785]
0x0000002aef262c70 JavaThread "RMI LeaseChecker" daemon [_thread_blocked, id=23378]
0x0000002aef1a4740 JavaThread "Timer-1" daemon [_thread_blocked, id=23012]
0x0000002af352c660 JavaThread "Thread-5" [_thread_blocked, id=23001]
0x0000002af2ed1f00 JavaThread "Thread-2" daemon [_thread_blocked, id=22948]
0x0000002af2e9b920 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=22946]
0x0000002af2e7cf90 JavaThread "RMI TCP Accept-11223" daemon [_thread_in_native, id=22945]
0x0000002af2e79640 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=22944]
0x0000002af2e760d0 JavaThread "Timer-0" daemon [_thread_blocked, id=22943]
0x0000002aeedfe740 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=22942]
0x0000002aeedfcb20 JavaThread "CompilerThread1" daemon [_thread_blocked, id=22941]
0x0000002aeedfb580 JavaThread "CompilerThread0" daemon [_thread_blocked, id=22940]
0x0000002aeedf9e30 JavaThread "AdapterThread" daemon [_thread_blocked, id=22939]
0x0000002aeedf8ce0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=22938]
0x0000002aebf9ef20 JavaThread "Finalizer" daemon [_thread_blocked, id=22937]
0x0000002aebf9e640 JavaThread "Reference Handler" daemon [_thread_blocked, id=22936]
0x00000000401171b0 JavaThread "main" [_thread_blocked, id=22926]
Other Threads:
=>0x0000002aebf9a230 VMThread [id=22935]
VM state:at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x0000000040115f60/0x0000000040115fb0] Threads_lock - owner thread: 0x0000002aebf9a230
[0x0000000040116650/0x0000000040116680] Heap_lock - owner thread: 0x0000002af3225d20
Heap
PSYoungGen total 2816K, used 227K [0x0000002ae7b10000, 0x0000002ae8270000, 0x0000002aebdb0000)
eden space 2560K, 0% used [0x0000002ae7b10000,0x0000002ae7b10000,0x0000002ae7d90000)
from space 256K, 88% used [0x0000002ae7d60000,0x0000002ae7d98f00,0x0000002ae7da0000)
to space 18014398509481792K, 0% used [0x0000002ae7d90000,0x0000002ae7d90000,0x0000002ae7d60000)
PSOldGen total 18112K, used 17862K [0x0000002adf5b0000, 0x0000002ae0760000, 0x0000002ae7b10000)
object space 18112K, 98% used [0x0000002adf5b0000,0x0000002ae0721890,0x0000002ae0760000)
PSPermGen total 24064K, used 23990K [0x0000002ada3b0000, 0x0000002adbb30000, 0x0000002adf5b0000)
object space 24064K, 99% used [0x0000002ada3b0000,0x0000002adbb1d940,0x0000002adbb30000)
Dynamic libraries:
40000000-4000e000 r-xp 00000000 08:06 2114894 /usr/java/jdk1.5.0_06/bin/java
VM Arguments:
jvm_args: -Dcom.sun.management.jmxremote=true - Dcom.sun.management.jmxremote.port=11223 - Dcom.sun.management.jmxremote.authenticate=false -Xms200m -Xmx200m -XX:+PrintGCTimeStamps - XX:+PrintGCDetails -Xloggc:/tmp/gc.log
java_command: org.jpos.q2.Q2 -d /home/server/deploy
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=/usr/java/jdk1.5.0_06
PATH=/home/server/deploy:/home/server/bin:/usr/java/jdk1.5.0_06/bin:/opt/apache-ant- 1.6.2/bin:/usr/lib64/qt- 3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/server/bin LD_LIBRARY_PATH=/usr/java/jdk1.5.0_06/jre/lib/amd64/server:/usr/java/jdk1.5.0_06/jre/lib/amd64:/usr/java/jdk1.5.0_06/jre/../lib/amd64
SHELL=/bin/bash
Signal Handlers:
SIGTERM: [libjvm.so+0x5549e0], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
--------------- S Y S T E M ---------------
OS:Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
uname:Linux 2.6.9-89.ELsmp #1 SMP Mon Apr 20 10:33:05 EDT 2009 x86_64
libc:glibc 2.3.4 NPTL 2.3.4
rlimit: STACK 10240k, CORE 0k, NPROC 278528, NOFILE 1024, AS infinity
load average:0.06 0.04 0.04
CPU:total 8 em64t ht
Memory: 4k page, physical 32934232k(90420k free), swap 30716272k(30151460k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (1.5.0_06-b05) for linux-amd64, built on Nov 10 2005 11:45:12 by java_re with gcc 3.2.2 (SuSE Linux)
提前致谢(^o^)
请您参考如下方法:
看起来可能是内存泄漏的迹象。我建议获得一个自动 HeapDump 添加
-XX:+HeapDumpOnOutOfMemoryError
切换到 Java 参数。并通过各种工具运行,例如 VisualVM 或 Eclipse Memory Analyzer