线上JAVA应用平稳运行一段时间后出现JVM崩溃问题 | 京东云技术团队

一、问题是怎么发现的

系统是一个定时任务系统,需要定时执行业务代码,业务代码主要是访问MYSQL数据库和缓存进行操作,该开始启动,系统日志一切正常,但是运行一段时间到凌晨后,系统就自动崩溃了,java进程没有了,只留下了程序崩溃日志如下:

1cat: /proc/1/environ: Permission denied 2[admin@host-11-40-38-52 ~]$ more hs_err_pid231.log 3# 4# A fatal error has been detected by the Java Runtime Environment: 5# 6# SIGSEGV (0xb) at pc=0x00007f21a8c21325, pid=231, tid=139779725313792 7# 8# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26) 9# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b23 mixed mode linux-amd64 c 10ompressed oops) 11# Problematic frame: 12# V [libjvm.so+0x858325] LoadKlassNode::make(PhaseGVN&, Node*, Node*, TypePtr 13const*, TypeKlassPtr const*)+0x45 14# 15# Core dump written. Default location: /home/admin/core or core.231 16# 17# If you would like to submit a bug report, please visit: 18# http://bugreport.sun.com/bugreport/crash.jsp 19# 20 21--------------- T H R E A D --------------- 22 23Current thread (0x00007f21a4b80800): JavaThread "C2 CompilerThread5" daemon [_t 24hread_in_native, id=398, stack(0x00007f2100cfc000,0x00007f2100dfd000)] 25 26siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000 27000010 28 29Registers: 30RAX=0x00007f21a48fbab0, RBX=0x00007f21a48fe4b0, RCX=0x0000000000000000, RDX=0x00 31000000fffffff4 32RSP=0x00007f2100df9c40, RBP=0x00007f2100df9c80, RSI=0x00007f20b00e9050, RDI=0x00 33007f1fe84e3650 34R8 =0x00007f21a48fe4b0, R9 =0x00007f21a48fbab0, R10=0x00007f1ffc059d90, R11=0x00 35007f21a8cf3560 36R12=0x00007f2100dfad00, R13=0x00007f1fe84e3650, R14=0x00007f2100dfa100, R15=0x00 37007f2100df9ee0 38RIP=0x00007f21a8c21325, EFLAGS=0x0000000000010296, CSGSFS=0x0000000000000033, ER 39R=0x0000000000000004 40 TRAPNO=0x000000000000000e 41 42Top of Stack: (sp=0x00007f2100df9c40) 430x00007f2100df9c40: 00007f20b00e9050 00007f21a48fbab0 440x00007f2100df9c50: 00007f2100df9c80 00007f21a48fe4b0 450x00007f2100df9c60: 00007f21a48fd440 00007f1fe84e3650 460x00007f2100df9c70: 00007f21a8cf3560 00007f2100df9ee0 470x00007f2100df9c80: 00007f2100df9da0 00007f21a891acb6 480x00007f2100df9c90: 00007f1ffc5122a0 00007f20b00301d0 490x00007f2100df9ca0: 00007f2100df9ce0 00007f1ffc933fc0 500x00007f2100df9cb0: 00007f2100df9ee0 00007f1ffc933fc0 510x00007f2100df9cc0: 00007f2100df9cf0 00007f21a89ac798 520x00007f2100df9cd0: 00007f2100df9cf0 00007f2100dfad00 530x00007f2100df9ce0: 0000000000000000 0000000000000002 540x00007f2100df9cf0: 00007f1ffc933fc0 00007f1ffc93ba68 550x00007f2100df9d00: 0000000000000000 00007f1ffc93ba68 560x00007f2100df9d10: 00007f2100df9d30 00007f2100000002 570x00007f2100df9d20: 00007f1ffc93b828 0000000000000000 580x00007f2100df9d30: 00007f20b0029970 0000000500000004 590x00007f2100df9d40: 00007f20b00301d0 00007f00000001b0 600x00007f2100df9d50: 000000c700000e83 00007f1ffc93b828 610x00007f2100df9d60: 00007f2100dfa100 00007f1ffc5126a0 620x00007f2100df9d70: 0000000000001019 00007f1ffc933fc0 630x00007f2100df9d80: 00007f2100df9ee0 00007f2100df9db0 640x00007f2100df9d90: 0000000000000000 00007f2100df9fd8 650x00007f2100df9da0: 00007f2100df9df0 00007f21a8cd1b0a 660x00007f2100df9db0: 00007f2100df9ee0 0000000000000000 670x00007f2100df9dc0: 00007f1f00000001 00007f2100df9ee0 680x00007f2100df9dd0: 0000000000000000 00007f2100df9ee0 690x00007f2100df9de0: 0000000000000000 00000000000001b0 700x00007f2100df9df0: 00007f2100df9e30 00007f21a8cd46f0 710x00007f2100df9e00: 00007f2100df9e30 00007f2100dfabd0 720x00007f2100df9e10: 00007f20b00fd458 00007f2100df9ee0 730x00007f2100df9e20: 000000000000001f 00007f1ffc936508 740x00007f2100df9e30: 00007f2100df9e80 00007f21a8cd4967 75 76Instructions: (pc=0x00007f21a8c21325) 770x00007f21a8c21305: c0 48 8b 02 4c 8b 67 10 49 89 fe 48 89 d7 ff 50 780x00007f21a8c21315: 28 8b 50 10 31 c9 83 ea 0e 83 fa 07 48 0f 42 c8 790x00007f21a8c21325: 8b 41 10 83 e8 10 83 f8 02 0f 87 9c 01 00 00 80 800x00007f21a8c21335: 79 32 00 0f 84 92 01 00 00 49 8b 06 49 89 df 48 81 82Register to memory mapping: 83 84RAX=0x00007f21a48fbab0 is an unknown value 85RBX=0x00007f21a48fe4b0 is an unknown value 86RCX=0x0000000000000000 is an unknown value 87RDX=0x00000000fffffff4 is an unknown value 88RSP=0x00007f2100df9c40 is pointing into the stack for thread: 0x00007f21a4b80800 89RBP=0x00007f2100df9c80 is pointing into the stack for thread: 0x00007f21a4b80800 90RSI=0x00007f20b00e9050 is an unknown value 91RDI=0x00007f1fe84e3650 is an unknown value 92R8 =0x00007f21a48fe4b0 is an unknown value 93R9 =0x00007f21a48fbab0 is an unknown value 94R10=0x00007f1ffc059d90 is an unknown value 95R11=0x00007f21a8cf3560: <offset 0x92a560> in /home/export/servers/jdk1.8.0_20/jr 96e/lib/amd64/server/libjvm.so at 0x00007f21a83c9000 97R12=0x00007f2100dfad00 is pointing into the stack for thread: 0x00007f21a4b80800 98R13=0x00007f1fe84e3650 is an unknown value 99R14=0x00007f2100dfa100 is pointing into the stack for thread: 0x00007f21a4b80800 100R15=0x00007f2100df9ee0 is pointing into the stack for thread: 0x00007f21a4b80800 101 102 103Stack: [0x00007f2100cfc000,0x00007f2100dfd000], sp=0x00007f2100df9c40, free sp 104ace=1015k 105Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) 106V [libjvm.so+0x858325] LoadKlassNode::make(PhaseGVN&, Node*, Node*, TypePtr co 107nst*, TypeKlassPtr const*)+0x45 108V [libjvm.so+0x551cb6] Parse::catch_inline_exceptions(SafePointNode*)+0x946 109V [libjvm.so+0x908b0a] Parse::do_exceptions()+0xba 110V [libjvm.so+0x90b6f0] Parse::do_one_block()+0x180 111V [libjvm.so+0x90b967] Parse::do_all_blocks()+0x127 112V [libjvm.so+0x90fd58] Parse::Parse(JVMState*, ciMethod*, float, Parse*)+0x7b8 113V [libjvm.so+0x3e7d09] ParseGenerator::generate(JVMState*, Parse*)+0x99 114V [libjvm.so+0x4931cc] Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, b 115ool, bool, bool)+0x126c 116V [libjvm.so+0x3e67e8] C2Compiler::compile_method(ciEnv*, ciMethod*, int)+0x19 1178 118V [libjvm.so+0x49ba4a] CompileBroker::invoke_compiler_on_method(CompileTask*)+ 1190xc8a 120V [libjvm.so+0x49e420] CompileBroker::compiler_thread_loop()+0x620 121V [libjvm.so+0xa2990f] JavaThread::thread_main_inner()+0xdf 122V [libjvm.so+0xa29a3c] JavaThread::run()+0x11c 123V [libjvm.so+0x8e75f8] java_start(Thread*)+0x108 124C [libpthread.so.0+0x7aa1] start_thread+0xd1 125 126 127Current CompileTask: 128C2:43781461 13331 ! 4 com.mysql.cj.NativeSession::execSQL (579 bytes) 129 130 131--------------- P R O C E S S --------------- 132 133Java Threads: ( => current thread ) 134 0x00007f2010003800 JavaThread "qtp1589683045-1271" [_thread_blocked, id=142149 135, stack(0x00007f20fa995000,0x00007f20faa96000)] 136 0x00007f1f58001800 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=1 13740557, stack(0x00007f20f830e000,0x00007f20f840f000)] 138 0x00007f1fb005e800 JavaThread "logback-1" daemon [_thread_blocked, id=42936, s 139tack(0x00007f20fad99000,0x00007f20fae9a000)] 140 0x00007f1f7c0c3000 JavaThread "logback-8" daemon [_thread_blocked, id=565, sta 141ck(0x00007f20ea6f6000,0x00007f20ea7f7000)] 142 0x00007f1f50003000 JavaThread "logback-7" daemon [_thread_blocked, id=521, sta 143ck(0x00007f20fab97000,0x00007f20fac98000)] 144 0x00007f1f10001000 JavaThread "logback-6" daemon [_thread_blocked, id=520, sta 145ck(0x00007f20f002b000,0x00007f20f012c000)] 146 0x00007f1f74004800 JavaThread "logback-5" daemon [_thread_blocked, id=519, sta 147ck(0x00007f20f1830000,0x00007f20f1931000)] 148 0x00007f1f5441d000 JavaThread "UMP-CheckFileRemovedThread" daemon [_thread_blo 149cked, id=518, stack(0x00007f20ea7f7000,0x00007f20ea8f8000)] 150 0x00007f1f5441b800 JavaThread "UMP-ProfilerFileUpdateThread" daemon [_thread_b 151locked, id=517, stack(0x00007f20ea8f8000,0x00007f20ea9f9000)] 152 0x00007f1f54419800 JavaThread "UMP-WriteLog2FileThread-jvmLogger" daemon [_thr 153ead_blocked, id=516, stack(0x00007f20ea9f9000,0x00007f20eaafa000)] 154 0x00007f1f54418000 JavaThread "UMP-WriteLog2FileThread-commonLogger" daemon [_ 155thread_blocked, id=515, stack(0x00007f20eaafa000,0x00007f20eabfb000)] 156 0x00007f1f54416000 JavaThread "UMP-WriteLog2FileThread-tpLogger" daemon [_thre 157ad_blocked, id=514, stack(0x00007f20eabfb000,0x00007f20eacfc000)] 158 0x00007f1f5440f800 JavaThread "UMP-WriteLog2FileThread-bizLogger" daemon [_thr 159ead_blocked, id=513, stack(0x00007f20eacfc000,0x00007f20eadfd000)] 160 0x00007f1f54410800 JavaThread "UMP-WriteLog2FileThread-businessLogger" daemon 161[_thread_blocked, id=512, stack(0x00007f20eadfd000,0x00007f20eaefe000)] 162 0x00007f1f54408800 JavaThread "UMP-WriteLog2FileThread-aliveLogger" daemon [_t 163hread_blocked, id=511, stack(0x00007f20eaefe000,0x00007f20eafff000)] 164 0x00007f1f543da000 JavaThread "DatebookHikariCP2 housekeeper" daemon [_thread_ 165blocked, id=509, stack(0x00007f20f012c000,0x00007f20f022d000)] 166 0x00007f1f543cf800 JavaThread "Jim-NioEventLoop - 1" daemon [_thread_in_native 167, id=508, stack(0x00007f20f042d000,0x00007f20f052e000)] 168 0x00007f1f54259800 JavaThread "SystemClock" daemon [_thread_blocked, id=507, s 169tack(0x00007f20f172f000,0x00007f20f1830000)] 170 0x00007f1f54216000 JavaThread "DatebookHikariCP4 housekeeper" daemon [_thread_ 171blocked, id=505, stack(0x00007f20f289f000,0x00007f20f29a0000)] 172 0x00007f1f540b5000 JavaThread "UMP-WriteTPLogThread" daemon [_thread_blocked, 173id=504, stack(0x00007f20fa490000,0x00007f20fa591000)] 174 0x00007f1f50002000 JavaThread "logback-4" daemon [_thread_blocked, id=503, sta 175ck(0x00007f20fa38f000,0x00007f20fa490000)] 176 0x00007f1f74003000 JavaThread "logback-3" daemon [_thread_blocked, id=502, sta 177ck(0x00007f20f29a0000,0x00007f20f2aa1000)] 178 0x00007f21a4bc4000 JavaThread "http-nio-8001-Acceptor-0" daemon [_thread_in_na 179tive, id=501, stack(0x00007f20f1d31000,0x00007f20f1e32000)] 180 0x00007f21a4bc2000 JavaThread "http-nio-8001-ClientPoller-1" daemon [_thread_i 181n_native, id=500, stack(0x00007f20f1e32000,0x00007f20f1f33000)] 182 0x00007f21a4bc0000 JavaThread "http-nio-8001-ClientPoller-0" daemon [_thread_i 183n_native, id=499, stack(0x00007f20f1f33000,0x00007f20f2034000)] 184 0x00007f21a4bbe800 JavaThread "http-nio-8001-exec-10" daemon [_thread_blocked, 185 id=498, stack(0x00007f20f2034000,0x00007f20f2135000)] 186 0x00007f21a4958800 JavaThread "http-nio-8001-exec-9" daemon [_thread_blocked, 187id=497, stack(0x00007f20f2135000,0x00007f20f2236000)] 188 0x00007f21a4956800 JavaThread "http-nio-8001-exec-8" daemon [_thread_blocked, 189id=496, stack(0x00007f20f2236000,0x00007f20f2337000)] 190 0x00007f21a4955000 JavaThread "http-nio-8001-exec-7" daemon [_thread_blocked, 191id=495, stack(0x00007f20f2337000,0x00007f20f2438000)] 192 0x00007f21a4953800 JavaThread "http-nio-8001-exec-6" daemon [_thread_blocked, 193id=494, stack(0x00007f20f2438000,0x00007f20f2539000)] 194 0x00007f21a4952000 JavaThread "http-nio-8001-exec-5" daemon [_thread_blocked, 195id=493, stack(0x00007f20f2539000,0x00007f20f263a000)] 196 0x00007f21a4b7e800 JavaThread "http-nio-8001-exec-4" daemon [_thread_blocked, 197id=492, stack(0x00007f20f263a000,0x00007f20f273b000)] 198 0x00007f21a4b7d000 JavaThread "http-nio-8001-exec-3" daemon [_thread_blocked, 199id=491, stack(0x00007f20f273b000,0x00007f20f283c000)] 200 0x00007f21a4b7b800 JavaThread "http-nio-8001-exec-2" daemon [_thread_blocked, 201id=490, stack(0x00007f20f2cfd000,0x00007f20f2dfe000)] 202 0x00007f21a4b7a000 JavaThread "http-nio-8001-exec-1" daemon [_thread_blocked, 203id=489, stack(0x00007f20f2dfe000,0x00007f20f2eff000)] 204 0x00007f21a4b78800 JavaThread "ContainerBackgroundProcessor[StandardEngine[Cat 205alina]]" daemon [_thread_blocked, id=488, stack(0x00007f20f2aa1000,0x00007f20f2b 206a2000)] 207 0x00007f1f7cb62800 JavaThread "scheduling-1" [_thread_in_native, id=487, stack 208(0x00007f20f2ba2000,0x00007f20f2ca3000)] 209 0x00007f1f74001000 JavaThread "logback-2" daemon [_thread_blocked, id=486, sta 210ck(0x00007f20f2eff000,0x00007f20f3000000)] 211 0x00007f1f7ca2b800 JavaThread "Jim-ConfigPoolingHeartbeat-1571143858733" daemo 212n [_thread_in_native, id=442, stack(0x00007f20f800b000,0x00007f20f810c000)] 213 0x00007f1f7c913800 JavaThread "mysql-cj-abandoned-connection-cleanup" daemon [ 214_thread_blocked, id=441, stack(0x00007f20f8833000,0x00007f20f8934000)] 215 0x00007f1f7c7b8800 JavaThread "configurator-supervise" daemon [_thread_blocked 216, id=440, stack(0x00007f20f810c000,0x00007f20f820d000)] 217 0x00007f1f7c7b7000 JavaThread "Thread-51" daemon [_thread_blocked, id=439, sta 218ck(0x00007f20f820d000,0x00007f20f830e000)] 219 0x00007f1f7c71e000 JavaThread "JSF-Future-Checker-CB-1-T-1" daemon [_thread_bl 220ocked, id=436, stack(0x00007f20f8b34000,0x00007f20f8c35000)] 221 0x00007f1f7c71d800 JavaThread "JSF-Future-Checker-0-T-1" daemon [_thread_block 222ed, id=435, stack(0x00007f20f9bc2000,0x00007f20f9cc3000)] 223 0x00007f1f7c3ba000 JavaThread "logback-1" daemon [_thread_blocked, id=433, sta 224ck(0x00007f20f9635000,0x00007f20f9736000)] 225 0x00007f21a4e27800 JavaThread "NioBlockingSelector.BlockPoller-1" daemon [_thr 226ead_in_native, id=429, stack(0x00007f20fa591000,0x00007f20fa692000)] 227 0x00007f2030001000 JavaThread "qtp1589683045-59 Selector15" [_thread_in_native 228, id=414, stack(0x00007f20fb39f000,0x00007f20fb4a0000)] 229 0x00007f21a4da0800 JavaThread "GC Daemon" daemon [_thread_blocked, id=413, sta 230ck(0x00007f20fbafd000,0x00007f20fbbfe000)] 231 0x00007f21a4baa000 JavaThread "Service Thread" daemon [_thread_blocked, id=411 232, stack(0x00007f20fbeff000,0x00007f20fc000000)] 233 0x00007f21a4b9a800 JavaThread "C1 CompilerThread17" daemon [_thread_blocked, i 234d=410, stack(0x00007f21000f0000,0x00007f21001f1000)] 235 0x00007f21a4b98800 JavaThread "C1 CompilerThread16" daemon [_thread_blocked, i 236d=409, stack(0x00007f21001f1000,0x00007f21002f2000)] 237 0x00007f21a4b96800 JavaThread "C1 CompilerThread15" daemon [_thread_blocked, i 238d=408, stack(0x00007f21002f2000,0x00007f21003f3000)] 239 0x00007f21a4b94800 JavaThread "C1 CompilerThread14" daemon [_thread_blocked, i 240d=407, stack(0x00007f21003f3000,0x00007f21004f4000)] 241 0x00007f21a4b92000 JavaThread "C1 CompilerThread13" daemon [_thread_blocked, i 242d=406, stack(0x00007f21004f4000,0x00007f21005f5000)] 243 0x00007f21a4b90000 JavaThread "C1 CompilerThread12" daemon [_thread_blocked, i 244d=405, stack(0x00007f21005f5000,0x00007f21006f6000)] 245 0x00007f21a4b8e000 JavaThread "C2 CompilerThread11" daemon [_thread_blocked, i 246d=404, stack(0x00007f21006f6000,0x00007f21007f7000)] 247 0x00007f21a4b8b800 JavaThread "C2 CompilerThread10" daemon [_thread_blocked, i 248d=403, stack(0x00007f21007f7000,0x00007f21008f8000)] 249 0x00007f21a4b89800 JavaThread "C2 CompilerThread9" daemon [_thread_blocked, id 250=402, stack(0x00007f21008f8000,0x00007f21009f9000)] 251 0x00007f21a4b87000 JavaThread "C2 CompilerThread8" daemon [_thread_blocked, id 252=401, stack(0x00007f21009f9000,0x00007f2100afa000)] 253 0x00007f21a4b85000 JavaThread "C2 CompilerThread7" daemon [_thread_blocked, id 254=400, stack(0x00007f2100afa000,0x00007f2100bfb000)] 255 0x00007f21a4b83000 JavaThread "C2 CompilerThread6" daemon [_thread_blocked, id 256=399, stack(0x00007f2100bfb000,0x00007f2100cfc000)] 257=>0x00007f21a4b80800 JavaThread "C2 CompilerThread5" daemon [_thread_in_native, 258id=398, stack(0x00007f2100cfc000,0x00007f2100dfd000)] 259 0x00007f21a4b76800 JavaThread "C2 CompilerThread4" daemon [_thread_blocked, id 260=397, stack(0x00007f2100dfd000,0x00007f2100efe000)] 261 0x00007f21a4b74000 JavaThread "C2 CompilerThread3" daemon [_thread_blocked, id 262=396, stack(0x00007f2100efe000,0x00007f2100fff000)] 263 0x00007f21a4b72000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id 264=395, stack(0x00007f2108098000,0x00007f2108199000)] 265 0x00007f21a4b6f800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id 266=394, stack(0x00007f2108199000,0x00007f210829a000)] 267 0x00007f21a4b6e000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id 268=393, stack(0x00007f210829a000,0x00007f210839b000)] 269 0x00007f21a4b6b000 JavaThread "qtp1589683045-38 Selector14" [_thread_in_native 270, id=392, stack(0x00007f210839b000,0x00007f210849c000)] 271 0x00007f21a4b69000 JavaThread "qtp1589683045-37 Selector13" [_thread_in_native 272, id=391, stack(0x00007f210849c000,0x00007f210859d000)] 273 0x00007f21a4b67000 JavaThread "qtp1589683045-36 Selector12" [_thread_in_native 274, id=390, stack(0x00007f210859d000,0x00007f210869e000)] 275 0x00007f21a4b65000 JavaThread "qtp1589683045-35 Selector11" [_thread_in_native 276, id=389, stack(0x00007f210869e000,0x00007f210879f000)] 277 0x00007f21a4b62800 JavaThread "qtp1589683045-34 Selector10" [_thread_in_native 278, id=388, stack(0x00007f210879f000,0x00007f21088a0000)] 279 0x00007f21a4b60800 JavaThread "qtp1589683045-33 Selector9" [_thread_in_native, 280 id=387, stack(0x00007f21088a0000,0x00007f21089a1000)] 281 0x00007f21a4b5e800 JavaThread "qtp1589683045-32 Selector8" [_thread_in_native, 282 id=386, stack(0x00007f21089a1000,0x00007f2108aa2000)] 283 0x00007f21a4b5c800 JavaThread "qtp1589683045-31 Selector7" [_thread_in_native, 284 id=385, stack(0x00007f2108aa2000,0x00007f2108ba3000)] 285 0x00007f21a4b5a800 JavaThread "qtp1589683045-30 Selector6" [_thread_in_native, 286 id=384, stack(0x00007f2108ba3000,0x00007f2108ca4000)] 287 0x00007f21a4b58800 JavaThread "qtp1589683045-29 Selector5" [_thread_in_native, 288 id=383, stack(0x00007f2108ca4000,0x00007f2108da5000)] 289 0x00007f21a4b56800 JavaThread "qtp1589683045-28 Selector4" [_thread_in_native, 290 id=382, stack(0x00007f2108da5000,0x00007f2108ea6000)] 291 0x00007f21a4b54800 JavaThread "qtp1589683045-27 Selector3" [_thread_in_native, 292 id=381, stack(0x00007f2108ea6000,0x00007f2108fa7000)] 293 0x00007f21a4b52800 JavaThread "qtp1589683045-26 Selector2" [_thread_in_native, 294 id=380, stack(0x00007f2108fa7000,0x00007f21090a8000)] 295 0x00007f21a4b50800 JavaThread "qtp1589683045-25 Selector1" [_thread_in_native, 296 id=379, stack(0x00007f21090a8000,0x00007f21091a9000)] 297 0x00007f21a49ad800 JavaThread "qtp1589683045-24 Selector0" [_thread_in_native, 298 id=378, stack(0x00007f21091a9000,0x00007f21092aa000)] 299 0x00007f21a49ac000 JavaThread "qtp1589683045-23 Acceptor15 SelectChannelConnec 300tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=377, stack(0x00007f21092aa000,0x 30100007f21093ab000)] 302 0x00007f21a49a8800 JavaThread "qtp1589683045-22 Acceptor14 SelectChannelConnec 303tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=376, stack(0x00007f21093ab000,0x 30400007f21094ac000)] 305 0x00007f21a49a6800 JavaThread "qtp1589683045-21 Acceptor13 SelectChannelConnec 306tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=375, stack(0x00007f21094ac000,0x 30700007f21095ad000)] 308 0x00007f21a49a4800 JavaThread "qtp1589683045-20 Acceptor12 SelectChannelConnec 309tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=374, stack(0x00007f21095ad000,0x 31000007f21096ae000)] 311 0x00007f21a49a2800 JavaThread "qtp1589683045-19 Acceptor11 SelectChannelConnec 312tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=373, stack(0x00007f21096ae000,0x 31300007f21097af000)] 314 0x00007f21a49a0800 JavaThread "qtp1589683045-18 Acceptor10 SelectChannelConnec 315tor@0.0.0.0:7001 STARTING" [_thread_blocked, id=372, stack(0x00007f21097af000,0x 31600007f21098b0000)] 317 0x00007f21a499e800 JavaThread "qtp1589683045-17 Acceptor9 SelectChannelConnect 318or@0.0.0.0:7001 STARTING" [_thread_blocked, id=371, stack(0x00007f21098b0000,0x0 3190007f21099b1000)] 320 0x00007f21a499d800 JavaThread "qtp1589683045-16 Acceptor7 SelectChannelConnect 321or@0.0.0.0:7001 STARTING" [_thread_in_native, id=370, stack(0x00007f21099b1000,0 322x00007f2109ab2000)] 323 0x00007f21a4994800 JavaThread "qtp1589683045-15 Acceptor8 SelectChannelConnect 324or@0.0.0.0:7001 STARTING" [_thread_blocked, id=369, stack(0x00007f2109ab2000,0x0 3250007f2109bb3000)] 326 0x00007f21a4992800 JavaThread "qtp1589683045-14 Acceptor6 SelectChannelConnect 327or@0.0.0.0:7001 STARTING" [_thread_blocked, id=368, stack(0x00007f2109bb3000,0x0 3280007f2109cb4000)] 329 0x00007f21a4990800 JavaThread "qtp1589683045-13 Acceptor3 SelectChannelConnect 330or@0.0.0.0:7001 STARTING" [_thread_blocked, id=367, stack(0x00007f2109cb4000,0x0 3310007f2109db5000)] 332 0x00007f21a498e800 JavaThread "qtp1589683045-12 Acceptor2 SelectChannelConnect 333or@0.0.0.0:7001 STARTING" [_thread_blocked, id=366, stack(0x00007f2109db5000,0x0 3340007f2109eb6000)] 335 0x00007f21a498c800 JavaThread "qtp1589683045-11 Acceptor5 SelectChannelConnect 336or@0.0.0.0:7001 STARTING" [_thread_blocked, id=365, stack(0x00007f2109eb6000,0x0 3370007f2109fb7000)] 338 0x00007f21a498a800 JavaThread "qtp1589683045-10 Acceptor4 SelectChannelConnect 339or@0.0.0.0:7001 STARTING" [_thread_blocked, id=364, stack(0x00007f2109fb7000,0x0 3400007f210a0b8000)] 341 0x00007f21a4988800 JavaThread "qtp1589683045-9 Acceptor1 SelectChannelConnecto 342r@0.0.0.0:7001 STARTING" [_thread_blocked, id=363, stack(0x00007f210a0b8000,0x00 343007f210a1b9000)] 344 0x00007f21a4987000 JavaThread "qtp1589683045-8 Acceptor0 SelectChannelConnecto 345r@0.0.0.0:7001 STARTING" [_thread_blocked, id=362, stack(0x00007f210a1b9000,0x00 346007f210a2ba000)] 347 0x00007f21a497c000 JavaThread "HashSessionScavenger-0" daemon [_thread_blocked 348, id=361, stack(0x00007f210a2ba000,0x00007f210a3bb000)] 349 0x00007f21a46a5800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id= 350360, stack(0x00007f210abec000,0x00007f210aced000)] 351 0x00007f21a4676800 JavaThread "Finalizer" daemon [_thread_blocked, id=359, sta 352ck(0x00007f210aced000,0x00007f210adee000)] 353 0x00007f21a4674800 JavaThread "Reference Handler" daemon [_thread_blocked, id= 354358, stack(0x00007f210adee000,0x00007f210aeef000)] 355 0x00007f21a400b000 JavaThread "main" [_thread_in_native, id=243, stack(0x00007 356f21a9e2b000,0x00007f21a9f2c000)] 357 358Other Threads: 359 0x00007f21a466d800 VMThread [stack: 0x00007f210aeef000,0x00007f210aff0000] [id 360=355] 361 0x00007f21a4bad000 WatcherThread [stack: 0x00007f20fbdfe000,0x00007f20fbeff000 362] [id=412] 363 364VM state:not at safepoint (normal execution) 365 366VM Mutex/Monitor currently owned by a thread: None 367 368Heap: 369 PSYoungGen total 1305088K, used 1009509K [0x000000076ab00000, 0x00000007c0 370000000, 0x00000007c0000000) 371 eden space 1209856K, 82% used [0x000000076ab00000,0x00000007a7b58fa8,0x0000000 3727b4880000) 373 from space 95232K, 10% used [0x00000007ba300000,0x00000007bac804c0,0x00000007c 3740000000) 375 to space 92672K, 0% used [0x00000007b4880000,0x00000007b4880000,0x00000007ba 376300000) 377 ParOldGen total 2796544K, used 50182K [0x00000006c0000000, 0x000000076ab0 3780000, 0x000000076ab00000) 379 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c31019c8,0x000000 380076ab00000) 381 Metaspace used 69176K, capacity 71536K, committed 71808K, reserved 111206 3824K 383 class space used 7973K, capacity 8461K, committed 8576K, reserved 1048576K 384 385Card table byte_map: [0x00007f21937c9000,0x00007f2193fca000] byte_map_base: 0x00 386007f21901c9000 387 388Marking Bits: (ParMarkBitMap*) 0x00007f21a9320ac0 389 Begin Bits: [0x00007f20a4000000, 0x00007f20a8000000) 390 End Bits: [0x00007f20a8000000, 0x00007f20ac000000) 391 392Polling page: 0x00007f21a9f33000 393 394CodeCache: size=245760Kb used=45854Kb max_used=45878Kb free=199905Kb 395 bounds [0x00007f219438a000, 0x00007f219709a000, 0x00007f21a338a000] 396 total_blobs=11396 nmethods=10825 adapters=479 397 compilation: enabled 398 399Compilation events (10 events): 400Event: 42853.758 Thread 0x00007f21a4b98800 nmethod 13322 0x00007f21967d2650 code 401 [0x00007f21967d2840, 0x00007f21967d30f8] 402Event: 42941.467 Thread 0x00007f21a4b89800 13327 4 java.util.concurr 403ent.ScheduledThreadPoolExecutor$DelayedWorkQueue::add (9 bytes) 404Event: 42941.467 Thread 0x00007f21a4b87000 13328 ! 4 java.util.concurr 405ent.ScheduledThreadPoolExecutor$DelayedWorkQueue::offer (124 bytes) 406Event: 42941.467 Thread 0x00007f21a4b80800 13329 4 java.util.concurr 407ent.ThreadPoolExecutor::ensurePrestart (41 bytes) 408Event: 42941.469 Thread 0x00007f21a4b80800 nmethod 13329 0x00007f21967d0dd0 code 409 [0x00007f21967d0f20, 0x00007f21967d0ff8] 410Event: 42941.493 Thread 0x00007f21a4b87000 nmethod 13328 0x00007f219708a2d0 code 411 [0x00007f219708a540, 0x00007f219708b680] 412Event: 42941.493 Thread 0x00007f21a4b89800 nmethod 13327 0x00007f2197070390 code 413 [0x00007f2197070600, 0x00007f2197071700] 414Event: 43421.467 Thread 0x00007f21a4b74000 13330 4 com.mysql.cj.resu 415lt.DefaultColumnDefinition::<init> (41 bytes) 416Event: 43421.469 Thread 0x00007f21a4b74000 nmethod 13330 0x00007f2196854910 code 417 [0x00007f2196854a60, 0x00007f2196854b78] 418Event: 43781.449 Thread 0x00007f21a4b80800 13331 ! 4 com.mysql.cj.Nati 419veSession::execSQL (579 bytes) 420 421GC Heap History (10 events): 422Event: 2901.101 GC heap before 423{Heap before GC invocations=9 (full 3): 424 PSYoungGen total 1223168K, used 1048576K [0x000000076ab00000, 0x00000007c0 425000000, 0x00000007c0000000) 426 eden space 1048576K, 100% used [0x000000076ab00000,0x00000007aab00000,0x000000 42707aab00000) 428 from space 174592K, 0% used [0x00000007aab00000,0x00000007aab00000,0x00000007b 4295580000) 430 to space 101376K, 0% used [0x00000007b9d00000,0x00000007b9d00000,0x00000007c 4310000000) 432 ParOldGen total 2796544K, used 50126K [0x00000006c0000000, 0x000000076ab0 4330000, 0x000000076ab00000) 434 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30f39b8,0x000000 435076ab00000) 436 Metaspace used 67592K, capacity 69946K, committed 70144K, reserved 111206 4374K 438 class space used 7943K, capacity 8414K, committed 8448K, reserved 1048576K 439Event: 2901.121 GC heap after 440Heap after GC invocations=9 (full 3): 441 PSYoungGen total 1296896K, used 14251K [0x000000076ab00000, 0x00000007c000 4420000, 0x00000007c0000000) 443 eden space 1195520K, 0% used [0x000000076ab00000,0x000000076ab00000,0x00000007 444b3a80000) 445 from space 101376K, 14% used [0x00000007b9d00000,0x00000007baaeaf98,0x00000007 446c0000000) 447 to space 100864K, 0% used [0x00000007b3a80000,0x00000007b3a80000,0x00000007b 4489d00000) 449 ParOldGen total 2796544K, used 50150K [0x00000006c0000000, 0x000000076ab0 4500000, 0x000000076ab00000) 451 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30f99c8,0x000000 452076ab00000) 453 Metaspace used 67592K, capacity 69946K, committed 70144K, reserved 111206 4544K 455 class space used 7943K, capacity 8414K, committed 8448K, reserved 1048576K 456} 457Event: 10747.104 GC heap before 458{Heap before GC invocations=10 (full 3): 459 PSYoungGen total 1296896K, used 1209771K [0x000000076ab00000, 0x00000007c0 460000000, 0x00000007c0000000) 461 eden space 1195520K, 100% used [0x000000076ab00000,0x00000007b3a80000,0x000000 46207b3a80000) 463 from space 101376K, 14% used [0x00000007b9d00000,0x00000007baaeaf98,0x00000007 464c0000000) 465 to space 100864K, 0% used [0x00000007b3a80000,0x00000007b3a80000,0x00000007b 4669d00000) 467 ParOldGen total 2796544K, used 50150K [0x00000006c0000000, 0x000000076ab0 4680000, 0x000000076ab00000) 469 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30f99c8,0x000000 470076ab00000) 471 Metaspace used 68322K, capacity 70672K, committed 70912K, reserved 111206 4724K 473 class space used 7963K, capacity 8423K, committed 8448K, reserved 1048576K 474Event: 10747.119 GC heap after 475Heap after GC invocations=10 (full 3): 476 PSYoungGen total 1296384K, used 10324K [0x000000076ab00000, 0x00000007c000 4770000, 0x00000007c0000000) 478 eden space 1195520K, 0% used [0x000000076ab00000,0x000000076ab00000,0x00000007 479b3a80000) 480 from space 100864K, 10% used [0x00000007b3a80000,0x00000007b44951c8,0x00000007 481b9d00000) 482 to space 99840K, 0% used [0x00000007b9e80000,0x00000007b9e80000,0x00000007c0 483000000) 484 ParOldGen total 2796544K, used 50158K [0x00000006c0000000, 0x000000076ab0 4850000, 0x000000076ab00000) 486 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30fb9c8,0x000000 487076ab00000) 488 Metaspace used 68322K, capacity 70672K, committed 70912K, reserved 111206 4894K 490 class space used 7963K, capacity 8423K, committed 8448K, reserved 1048576K 491} 492Event: 18892.422 GC heap before 493{Heap before GC invocations=11 (full 3): 494 PSYoungGen total 1296384K, used 1205844K [0x000000076ab00000, 0x00000007c0 495000000, 0x00000007c0000000) 496 eden space 1195520K, 100% used [0x000000076ab00000,0x00000007b3a80000,0x000000 49707b3a80000) 498 from space 100864K, 10% used [0x00000007b3a80000,0x00000007b44951c8,0x00000007 499b9d00000) 500 to space 99840K, 0% used [0x00000007b9e80000,0x00000007b9e80000,0x00000007c0 501000000) 502 ParOldGen total 2796544K, used 50158K [0x00000006c0000000, 0x000000076ab0 5030000, 0x000000076ab00000) 504 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30fb9c8,0x000000 505076ab00000) 506 Metaspace used 68759K, capacity 71020K, committed 71168K, reserved 111206 5074K 508 class space used 7970K, capacity 8429K, committed 8448K, reserved 1048576K 509Event: 18892.439 GC heap after 510Heap after GC invocations=11 (full 3): 511 PSYoungGen total 1299968K, used 9668K [0x000000076ab00000, 0x00000007c0000 512000, 0x00000007c0000000) 513 eden space 1200128K, 0% used [0x000000076ab00000,0x000000076ab00000,0x00000007 514b3f00000) 515 from space 99840K, 9% used [0x00000007b9e80000,0x00000007ba7f11f8,0x00000007c0 516000000) 517 to space 97792K, 0% used [0x00000007b3f00000,0x00000007b3f00000,0x00000007b9 518e80000) 519 ParOldGen total 2796544K, used 50166K [0x00000006c0000000, 0x000000076ab0 5200000, 0x000000076ab00000) 521 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30fd9c8,0x000000 522076ab00000) 523 Metaspace used 68759K, capacity 71020K, committed 71168K, reserved 111206 5244K 525 class space used 7970K, capacity 8429K, committed 8448K, reserved 1048576K 526} 527Event: 27681.725 GC heap before 528{Heap before GC invocations=12 (full 3): 529 PSYoungGen total 1299968K, used 1209796K [0x000000076ab00000, 0x00000007c0 530000000, 0x00000007c0000000) 531 eden space 1200128K, 100% used [0x000000076ab00000,0x00000007b3f00000,0x000000 53207b3f00000) 533 from space 99840K, 9% used [0x00000007b9e80000,0x00000007ba7f11f8,0x00000007c0 534000000) 535 to space 97792K, 0% used [0x00000007b3f00000,0x00000007b3f00000,0x00000007b9 536e80000) 537 ParOldGen total 2796544K, used 50166K [0x00000006c0000000, 0x000000076ab0 5380000, 0x000000076ab00000) 539 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30fd9c8,0x000000 540076ab00000) 541 Metaspace used 68898K, capacity 71216K, committed 71424K, reserved 111206 5424K 543 class space used 7971K, capacity 8429K, committed 8448K, reserved 1048576K 544Event: 27681.740 GC heap after 545Heap after GC invocations=12 (full 3): 546 PSYoungGen total 1297920K, used 9809K [0x000000076ab00000, 0x00000007c0000 547000, 0x00000007c0000000) 548 eden space 1200128K, 0% used [0x000000076ab00000,0x000000076ab00000,0x00000007 549b3f00000) 550 from space 97792K, 10% used [0x00000007b3f00000,0x00000007b48944d0,0x00000007b 5519e80000) 552 to space 95232K, 0% used [0x00000007ba300000,0x00000007ba300000,0x00000007c0 553000000) 554 ParOldGen total 2796544K, used 50174K [0x00000006c0000000, 0x000000076ab0 5550000, 0x000000076ab00000) 556 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30ff9c8,0x000000 557076ab00000) 558 Metaspace used 68898K, capacity 71216K, committed 71424K, reserved 111206 5594K 560 class space used 7971K, capacity 8429K, committed 8448K, reserved 1048576K 561} 562Event: 36688.570 GC heap before 563{Heap before GC invocations=13 (full 3): 564 PSYoungGen total 1297920K, used 1209937K [0x000000076ab00000, 0x00000007c0 565000000, 0x00000007c0000000) 566 eden space 1200128K, 100% used [0x000000076ab00000,0x00000007b3f00000,0x000000 56707b3f00000) 568 from space 97792K, 10% used [0x00000007b3f00000,0x00000007b48944d0,0x00000007b 5699e80000) 570 to space 95232K, 0% used [0x00000007ba300000,0x00000007ba300000,0x00000007c0 571000000) 572 ParOldGen total 2796544K, used 50174K [0x00000006c0000000, 0x000000076ab0 5730000, 0x000000076ab00000) 574 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c30ff9c8,0x000000 575076ab00000) 576 Metaspace used 69049K, capacity 71376K, committed 71552K, reserved 111206 5774K 578 class space used 7972K, capacity 8461K, committed 8576K, reserved 1048576K 579Event: 36688.584 GC heap after 580Heap after GC invocations=13 (full 3): 581 PSYoungGen total 1305088K, used 9729K [0x000000076ab00000, 0x00000007c0000 582000, 0x00000007c0000000) 583 eden space 1209856K, 0% used [0x000000076ab00000,0x000000076ab00000,0x00000007 584b4880000) 585 from space 95232K, 10% used [0x00000007ba300000,0x00000007bac804c0,0x00000007c 5860000000) 587 to space 92672K, 0% used [0x00000007b4880000,0x00000007b4880000,0x00000007ba 588300000) 589 ParOldGen total 2796544K, used 50182K [0x00000006c0000000, 0x000000076ab0 5900000, 0x000000076ab00000) 591 object space 2796544K, 1% used [0x00000006c0000000,0x00000006c31019c8,0x000000 592076ab00000) 593 Metaspace used 69049K, capacity 71376K, committed 71552K, reserved 111206 5944K 595 class space used 7972K, capacity 8461K, committed 8576K, reserved 1048576K 596} 597 598Deoptimization events (10 events): 599Event: 12281.446 Thread 0x00007f1f7cb62800 Uncommon trap: reason=unreached actio 600n=reinterpret pc=0x00007f2195f964f0 method=com.mysql.cj.result.DefaultColumnDefi 601nition.findColumn(Ljava/lang/String;ZI)I @ 28 602Event: 13726.994 Thread 0x00007f1f74001000 Uncommon trap: reason=unreached actio 603n=reinterpret pc=0x00007f2196c65958 method=java.util.concurrent.ScheduledThreadP 604oolExecutor$DelayedWorkQueue.take()Ljava/util/concurrent/RunnableScheduledFuture 605; @ 59 606Event: 14951.443 Thread 0x00007f1f7cb62800 Uncommon trap: reason=range_check act 607ion=make_not_entrant pc=0x00007f21966609f0 method=java.util.DualPivotQuicksort.s 608ort([IIIZ)V @ 56 609Event: 14951.507 Thread 0x00007f1f543cf800 Uncommon trap: reason=unreached actio 610n=reinterpret pc=0x00007f2196a0fad0 method=io.netty.util.internal.shaded.org.jct 611ools.queues.MpscArrayQueue.poll()Ljava/lang/Object; @ 28 612Event: 14951.507 Thread 0x00007f1f543cf800 Uncommon trap: reason=unreached actio 613n=reinterpret pc=0x00007f2196196cf8 method=io.netty.buffer.PooledByteBuf.interna 614lNioBuffer()Ljava/nio/ByteBuffer; @ 6 615Event: 16841.448 Thread 0x00007f1f543cf800 Uncommon trap: reason=unreached actio 616n=reinterpret pc=0x00007f21965db2ec method=java.util.concurrent.locks.AbstractQu 617euedSynchronizer.doReleaseShared()V @ 69 618Event: 43243.574 Thread 0x00007f1f54408800 Uncommon trap: reason=unreached actio 619n=reinterpret pc=0x00007f21959945c4 method=com.jd.ump.profiler.util.MessagesStor 620e$WriteLog2File.run()V @ 22 621Event: 43243.574 Thread 0x00007f1f54410800 Uncommon trap: reason=unreached actio 622n=reinterpret pc=0x00007f21959945c4 method=com.jd.ump.profiler.util.MessagesStor 623e$WriteLog2File.run()V @ 22 624Event: 43243.575 Thread 0x00007f1f5440f800 Uncommon trap: reason=unreached actio 625n=reinterpret pc=0x00007f21959945c4 method=com.jd.ump.profiler.util.MessagesStor 626e$WriteLog2File.run()V @ 22 627Event: 43243.575 Thread 0x00007f1f54418000 Uncommon trap: reason=unreached actio 628n=reinterpret pc=0x00007f21959945c4 method=com.jd.ump.profiler.util.MessagesStor 629e$WriteLog2File.run()V @ 22 630 631Internal exceptions (10 events): 632Event: 42812.465 Thread 0x00007f1f04001000 Exception <a 'java/net/SocketExceptio 633n'> (0x000000079fe54f30) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8 634u20/1074/hotspot/src/share/vm/prims/jni.cpp, line 716] 635Event: 42812.466 Thread 0x00007f1f04001000 Exception <a 'java/net/SocketExceptio 636n': Socket closed> (0x000000079fe57398) thrown at [/HUDSON/workspace/8-2-build-l 637inux-amd64/jdk8u20/1074/hotspot/src/share/vm/prims/jni.cpp, line 742] 638Event: 42813.148 Thread 0x00007f1f04001000 Exception <a 'java/net/SocketExceptio 639n'> (0x000000079fe578c0) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8 640u20/1074/hotspot/src/share/vm/prims/jni.cpp, line 716] 641Event: 42813.148 Thread 0x00007f1f04001000 Exception <a 'java/net/SocketExceptio 642n': Socket closed> (0x000000079fe59d28) thrown at [/HUDSON/workspace/8-2-build-l 643inux-amd64/jdk8u20/1074/hotspot/src/share/vm/prims/jni.cpp, line 742] 644Event: 42821.451 Thread 0x00007f1f7cb62800 Exception <a 'java/net/SocketExceptio 645n'> (0x000000079f1a5d90) thrown at [/HUDSON/workspace/8-2-build-linux-amd64/jdk8 646u20/1074/hotspot/src/share/vm/prims/jni.cpp, line 716]

二、排查问题的详细过程

当JVM 的初始化完成后,类在调用执行过程中,执行引擎会把字节码转为机器码,然后在操作系统中才能执行。在字节码转换为机器码的过程中,虚拟机中还存在着一道编译,那就是即时编译。

最初,JVM 中的字节码是由解释器( Interpreter )完成编译的,当虚拟机发现某个方法或代码块的运行特别频繁的时候,就会把这些代码认定为热点代码。

为了提高热点代码的执行效率,在运行时,即时编译器(JIT,Just In Time)会把这些代码编译成与本地平台相关的机器码,并进行各层次的优化,然后保存到内存中。

C1 编译器

C1 编译器是一个简单快速的编译器,主要的关注点在于局部性的优化,适用于执行时间较短或对启动性能有要求的程序,也称为Client Compiler,例如,GUI 应用对界面启动速度就有一定要求。

C2 编译器

C2 编译器是为长期运行的服务器端应用程序做性能调优的编译器,适用于执行时间较长或对峰值性能有要求的程序,也称为Server Compiler,例如,服务器上长期运行的 Java 应用对稳定运行就有一定的要求。

触发标准

在 HotSpot 虚拟机中,热点探测是 JIT 的触发标准。

热点探测是基于计数器的热点探测,采用这种方法的虚拟机会为每个方法建立计数器统计方法的执行次数,如果执行次数超过一定的阈值就认为它是“热点方法” 。虚拟机为每个方法准备了两类计数器:方法调用计数器(Invocation Counter)和回边计数器(Back Edge Counter)。在确定虚拟机运行参数的前提下,这两个计数器都有一个确定的阈值,当计数器超过阈值溢出了,就会触发 JIT 编译。

方法调用计数器

方法调用计数器用于统计方法被调用的次数,默认阈值在 C1 模式下是 1500 次,在 C2 模式在是 10000 次,可通过-XX: CompileThreshold来设定;而在分层编译的情况下-XX: CompileThreshold指定的阈值将失效,此时将会根据当前待编译的方法数以及编译线程数来动态调整。当方法计数器和回边计数器之和超过方法计数器阈值时,就会触发 JIT 编译器。

显然是定时任务一直在执行某一段程序代码,触发了JIT编译,所以JVM对该段代码进行JIT编译,但是在编译过程中出现了异常,导致JVM异常退出。

三、如何解决问题

既然知道了是由于热点代码执行次数过多触发了JIT编译,所以有两种解决方案

1:通过JVM命令进制对某个方法进行JIT编译,JVM相关配置命令如下

java -Xint -version ## 解释模式,输出interpreted mode

java –Xcomp -version ##编译模式,输出compiled mode

java -Xmixed -version ##混合模式,输出mixed mode

-XX:+PrintCompilation (输出jit编译信息)

-XX:CompileCommand=exclude,the/package/and/Class,methodName #判处指定的方法不做jit优化

-XX:CompileCommand='compileonly,java/lang/StringBuffer.*' #指定方法做编译

-XX:CompileThreshold=1000 #通过JIT编译器,将方法编译成机器码的触发阀值,可以理解为调用方法的次数,例如调1000次,将方法编译为机器码

2:考虑到之前使用老版本的mysql连接驱动,程序一直没有问题,所以对mysql驱动包进行降级,恢复到稳定版本,有问题的版本为spring-boot-2.1.6.RELEASE 依赖的mysql驱动

作者:京东零售 曹志飞

来源:京东云开发者社区 转载请注明来源

点赞
收藏

评论区

加载中...

相关推荐

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

Linux 命令全集

一、开关机sync:把内存中的数据写到磁盘中(关机、重启前都需先执行sync)shutdownrnow或reboot:立刻重启shutdownhnow:立刻关机shutdownh19:00:预定时间关闭系统(晚上7点关机,如果现在超过8点则第二天)shutdownh10:预定时间关闭系统(10分钟后关机)

04.Android崩溃Crash库之Loop拦截崩溃和ANR

目录总结01.能否利用Looper拦截崩溃02.思考几个问题分析03.App启动时自动开启Looper04.拦截主进程崩溃前沿上一篇整体介绍了crash崩溃库崩溃重启,崩溃记录记录,查看以及分享日志等功能。项目地址:https://github.com/yangchong

JFinal Quartz 支持配置文件和持久化

    随着需求的增加,现在要定时启动一个调度和计划任务,原先写的QuartzPlugin,是持久化保存到数据库中的,从数据库中读取任务并执行。要是添加一个每天循环任务,就要在代码里写一次开始任务的代码,执行后,再注释掉,最后重启项目。否则会因为启动同name,同group的任务而报错org.quartz.ObjectAlreadyExistsE

Hibernate纯sql查询结果和该sql在数据库直接查询结果不一致

问题:今天在做一个查询的时候发现一个问题,我先在数据库实现了我需要的sql,然后我在代码中代码:selectdistinctd.id,d.name,COALESCE(c.count_num,0),COALESCE(c.count_fix,0),COALESCE(c