codecache_jugmsk.pdf

 codecache_jugmsk.pdf

3fc5b5eb32bd3b48d7810fd67b37f9a1?s=128

Moscow JUG

May 30, 2019
Tweet

Transcript

  1. 23.

    Не все паузы из-за GC! Runtime: thread dump, class rede

    nition, monitor de ation JIT: выгрузка кода, обновление старого 10 / 122
  2. 27.

    PrintGCAST на Java 11 $ java -XX:+PrintGCApplicationStoppedTime \ -version Unrecognized

    VM option 'PrintGCApplicationStoppedTime' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 12 / 122
  3. 28.

    PrintGCAST на Java 11 $ java -XX:+PrintGCApplicationStoppedTime \ -version Unrecognized

    VM option 'PrintGCApplicationStoppedTime' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 12 / 122
  4. 29.

    Java 11: -Xlog:safepoint*=info $ java -Xlog:safepoint*=info -version [0,081s][info][safepoint] Total time

    for which application threads were stopped: 0,0001413 seconds, Stopping threads took: 0,0000269 seconds 13 / 122
  5. 30.

    Java 11: -Xlog:safepoint*=info $ java -Xlog:safepoint*=info -version [0,081s][info][safepoint] Total time

    for which application threads were stopped: 0,0001413 seconds, Stopping threads took: 0,0000269 seconds 13 / 122
  6. 31.

    Java 11: -Xlog:safepoint*=info $ java -Xlog:safepoint*=info -version [0,081s][info][safepoint] Total time

    for which application threads were stopped: 0,0001413 seconds, Stopping threads took: 0,0000269 seconds JEP 158: Uni ed JVM Logging 13 / 122
  7. 35.

    Время отклика, сек jvm 1 jvm 2 jvm 3 1

    2 3 4 5 Время код же одинаковый код же одинаковый 15 / 122
  8. 37.

    Время отклика, сек jvm 1 jvm 2 jvm 3 1

    2 3 4 5 Время Перегружаем jvm 2! Перегружаем jvm 2! 16 / 122
  9. 40.

    Время отклика, сек jvm 1 jvm 2 jvm 3 1

    2 3 4 5 Время ( ╯° □°) ╯︵ ┻━ ┻ ( ╯° □°) ╯︵ ┻━ ┻ 16 / 122
  10. 42.

    top — наше всё PID VIRT RES %CPU %MEM TIME+

    COMMAND 45120 8,4g 4,5g 100 7,0 367:22 java -Dname=jvm1 45122 9,0g 4,5g 100 7,0 767:32 java -Dname=jvm2 45123 9,0g 4,5g 100 7,0 350:00 java -Dname=jvm3 17 / 122
  11. 43.

    top — наше всё PID VIRT RES %CPU %MEM TIME+

    COMMAND 45120 8,4g 4,5g 100 7,0 367:22 java -Dname=jvm1 45122 9,0g 4,5g 100 7,0 767:32 java -Dname=jvm2 45123 9,0g 4,5g 100 7,0 350:00 java -Dname=jvm3 jvm2 ест слишком много CPU! 17 / 122
  12. 44.

    top — наше всё PID VIRT RES %CPU %MEM TIME+

    COMMAND 45120 8,4g 4,5g 100 7,0 367:22 java -Dname=jvm1 45122 9,0g 4,5g 100 7,0 767:32 java -Dname=jvm2 45123 9,0g 4,5g 100 7,0 350:00 java -Dname=jvm3 Что же это может быть? 17 / 122
  13. 66.
  14. 67.

    Так у нас и было: На одном из Weblogic узлов

    заканчивался CodeCache Важные бизнес-операции работали в интерпретаторе 25 / 122
  15. 72.

    Смотрим stdout Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is

    full. Compiler has been disabled. Try increasing the code cache size using -XX:ReservedCodeCacheSize= 28 / 122
  16. 73.

    Смотрим stdout Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is

    full. Compiler has been disabled. Try increasing the code cache size using -XX:ReservedCodeCacheSize= Это жж не к добру 28 / 122
  17. 74.

    Смотрим stdout Java HotSpot(TM) 64-Bit Server VM warning: CodeCache is

    full. Compiler has been disabled. Try increasing the code cache size using -XX:ReservedCodeCacheSize= 28 / 122
  18. 79.

    Типичный размер CodeCache в HotSpot Java 6: 32MiB Java 7:

    32MiB Java 8: 240MiB Java 11: 240MiB * 29 / 122
  19. 85.

    Java 8 name=Code Cache Java 11 name=CodeHeap 'pro led nmethods'

    name=CodeHeap 'non-pro led nmethods' 32 / 122
  20. 86.

    Java 8 name=Code Cache Java 11 name=CodeHeap 'pro led nmethods'

    name=CodeHeap 'non-pro led nmethods' name=CodeHeap 'non-nmethods' 32 / 122
  21. 87.
  22. 90.

    JEP 197: Segmented Code Cache Горячий код расположен компактнее —

    процессору проще (iTLB, iCache) Выгрузка кода более эффективна (сегменты можно пропускать) 35 / 122
  23. 103.

    $ jstat -compiler pid Compiled 143920 Failed 0 Invalid 0

    Time 2974.98 FailedType 1 FailedMethod com/acme/... Проще всего — jstat 41 / 122
  24. 104.

    $ jstat -compiler pid Compiled 143920 Failed 0 Invalid 0

    Time 2974.98 FailedType 1 FailedMethod com/acme/... 143920 компиляций это сколько в байтах? 41 / 122
  25. 105.

    $ jstat -compiler pid Compiled 143920 Failed 0 Invalid 0

    Time 2974.98 FailedType 1 FailedMethod com/acme/... 143920 компиляций это сколько в байтах? 41 / 122
  26. 109.
  27. 110.

    jstat.java ps.println(" <n>["ms"|"s"]"); ps.println(" Where <n> is an integer and

    the suffi ps.println(" milliseconds("ms") or seconds("s"). T ps.println(" <count> Number of samples to take before term ps.println(" -J<flag> Pass <flag> directly to the runtime s // undocumented options: // -list [<vmid>] - list counter names // -snap <vmid> - snapshot counter values as name=value pai 43 / 122
  28. 111.

    документированные опции ps.println(" <n>["ms"|"s"]"); ps.println(" Where <n> is an integer

    and the suffi ps.println(" milliseconds("ms") or seconds("s"). T ps.println(" <count> Number of samples to take before term ps.println(" -J<flag> Pass <flag> directly to the runtime s // undocumented options: // -list [<vmid>] - list counter names 43 / 122
  29. 112.

    недокументированные // undocumented options: // -list [<vmid>] - list counter

    names // -snap <vmid> - snapshot counter values as name=value pai // name <pattern> output counters matching given pattern ps.println(" <n>["ms"|"s"]"); ps.println(" Where <n> is an integer and the suffi ps.println(" milliseconds("ms") or seconds("s"). T ps.println(" <count> Number of samples to take before term ps.println(" -J<flag> Pass <flag> directly to the runtime s 43 / 122
  30. 118.

    $ jstat -snap 42 \ -J-Djstat.showUnsupported=true | grep .ci. sun.ci.standardCompiles

    =142'458 sun.ci.standardBytes =67'817'047 sun.ci.nmethodCodeSize=447'317'824 sun.ci.nmethodSize =933'106'392 ... 46 / 122
  31. 119.

    $ jstat -snap 42 \ -J-Djstat.showUnsupported=true | grep .ci. sun.ci.standardCompiles

    =142'458 # в штуках sun.ci.standardBytes =67'817'047 sun.ci.nmethodCodeSize=447'317'824 sun.ci.nmethodSize =933'106'392 ... 46 / 122
  32. 120.

    $ jstat -snap 42 \ -J-Djstat.showUnsupported=true | grep .ci. sun.ci.standardCompiles

    =142'458 # в штуках sun.ci.standardBytes =67'817'047 # в байткодах sun.ci.nmethodCodeSize=447'317'824 sun.ci.nmethodSize =933'106'392 ... 46 / 122
  33. 121.

    $ jstat -snap 42 \ -J-Djstat.showUnsupported=true | grep .ci. sun.ci.standardCompiles

    =142'458 # в штуках sun.ci.standardBytes =67'817'047 # в байткодах sun.ci.nmethodCodeSize=447'317'824 # после inline sun.ci.nmethodSize =933'106'392 ... 46 / 122
  34. 122.

    $ jstat -snap 42 \ -J-Djstat.showUnsupported=true | grep .ci. sun.ci.standardCompiles

    =142'458 # в штуках sun.ci.standardBytes =67'817'047 # в байткодах sun.ci.nmethodCodeSize=447'317'824 # после inline sun.ci.nmethodSize =933'106'392 # после JIT ... 46 / 122
  35. 126.

    $ jcmd pid Compiler.codecache # java 11 CodeHeap 'non-profiled nmethods':

    size=120032Kb used=8260Kb max_used=8623Kb free=111771Kb CodeHeap 'profiled nmethods': used=22718Kb... CodeHeap 'non-nmethods': used=1295Kb... total_blobs=18019 nmethods=10356 adapters=611 , compilation: enabled stopped_count=0, restarted_count=0 full_count=0 49 / 122
  36. 127.

    $ jcmd pid Compiler.codecache # java 11 CodeHeap 'non-profiled nmethods':

    size=120032Kb used=8260Kb max_used=8623Kb free=111771Kb CodeHeap 'profiled nmethods': used=22718Kb... CodeHeap 'non-nmethods': used=1295Kb... total_blobs=18019 nmethods=10356 adapters=611 , compilation: enabled stopped_count=0, restarted_count=0 full_count=0 49 / 122
  37. 128.

    $ jcmd pid Compiler.codecache # java 11 CodeHeap 'non-profiled nmethods':

    size=120032Kb used=8260Kb max_used=8623Kb free=111771Kb CodeHeap 'profiled nmethods': used=22718Kb... CodeHeap 'non-nmethods': used=1295Kb... total_blobs=18019 nmethods=10356 adapters=611 , compilation: enabled stopped_count=0, restarted_count=0 full_count=0 49 / 122
  38. 129.

    $ jcmd pid Compiler.codecache # java 11 CodeHeap 'non-profiled nmethods':

    size=120032Kb used=8260Kb max_used=8623Kb free=111771Kb CodeHeap 'profiled nmethods': used=22718Kb... CodeHeap 'non-nmethods': used=1295Kb... total_blobs=18019 nmethods=10356 adapters=611 , compilation: enabled stopped_count=0, restarted_count=0 full_count=0 49 / 122
  39. 133.

    jcmd 11: Compiler.CodeHeap_Analytics Статистика по областям CodeCache Статистика по зачистке

    CodeCache Самые большие методы Фрагментация CodeCache 50 / 122
  40. 134.

    jcmd 11: Compiler.CodeHeap_Analytics Статистика по областям CodeCache Статистика по зачистке

    CodeCache Самые большие методы Фрагментация CodeCache Много чего ещё 50 / 122
  41. 139.

    CodeCache (MiB), SpringBoot 2.1.3 PetClinic, Java 11 19 после старта

    29 прогрев / 34 прогрев /vets.html 10 20 30 40 52 / 122
  42. 141.
  43. 142.

    Чем больше классов — тем больше нужен CodeCache Затянули 2

    версии Guava — готовьте CodeCache У вас XML/XPath/... — ну вы поняли 53 / 122
  44. 146.

    HotSpot: очистка запускается когда Места в CodeCache нет Место есть,

    но с прошлой очистки прошло время 55 / 122
  45. 148.
  46. 156.

    Как уменьшить память, потребляемую JIT? отключить C2: нет C2 —

    нет проблем Повысить пороги на C2 компиляцию: -XX:Tier4CompileThreshold=... 61 / 122
  47. 157.

    Как уменьшить память, потребляемую JIT? отключить C2: нет C2 —

    нет проблем Повысить пороги на C2 компиляцию: -XX:Tier4CompileThreshold=... Попробовать другой JIT: OpenJ9, Zing, Excelsior, GraalVM 61 / 122
  48. 159.
  49. 163.
  50. 166.

    private static final Throwable EOI = ...; private char getNext(){

    assert(index <= input.length); try { return input[index++]; } catch (ArrayIndexOutOfBoundsException e) { throw EOI; } 66 / 122
  51. 167.

    index == input.length допустимо assert(index <= input.length); private static final

    Throwable EOI = ...; private char getNext(){ try { return input[index++]; } catch (ArrayIndexOutOfBoundsException e) { throw EOI; } 66 / 122
  52. 168.

    может возникнуть AIOB return input[index++]; } catch (ArrayIndexOutOfBoundsException e) {

    private static final Throwable EOI = ...; private char getNext(){ assert(index <= input.length); try { throw EOI; } 66 / 122
  53. 169.

    если возникло, то кидаем заготовленную ошибку private static final Throwable

    EOI = ...; } catch (ArrayIndexOutOfBoundsException e) { throw EOI; private char getNext(){ assert(index <= input.length); try { return input[index++]; } 66 / 122
  54. 170.

    Внимание, вопрос! private static final Throwable EOI = ...; private

    char getNext(){ assert(index <= input.length); try { return input[index++]; } catch (ArrayIndexOutOfBoundsException e) { throw EOI; } 66 / 122
  55. 171.

    Сколько исключений будет создано при достижении throw EOI? } catch

    (ArrayIndexOutOfBoundsException e) { throw EOI; private static final Throwable EOI = ...; private char getNext(){ assert(index <= input.length); try { return input[index++]; } 66 / 122
  56. 172.

    1) Каждый раз новый иксепшн } catch (ArrayIndexOutOfBoundsException e) {

    throw EOI; private static final Throwable EOI = ...; private char getNext(){ assert(index <= input.length); try { return input[index++]; } 66 / 122
  57. 173.

    1) Каждый раз новый иксепшн 2) Один и он закэшируется

    } catch (ArrayIndexOutOfBoundsException e) { throw EOI; private static final Throwable EOI = ...; private char getNext(){ assert(index <= input.length); try { return input[index++]; } 66 / 122
  58. 174.

    1) Каждый раз новый иксепшн 2) Один и он закэшируется

    3) Ни одного } catch (ArrayIndexOutOfBoundsException e) { throw EOI; private static final Throwable EOI = ...; private char getNext(){ assert(index <= input.length); try { return input[index++]; } 66 / 122
  59. 182.

    HotSpot оптимизирует исключения, которые игнорируются в коде: NullPointerException ClassCastException ArrayIndexOutOfBoundsException

    ArrayStoreException Это регулируется флагом (+ по умолчанию) -XX:+OmitStackTraceInFastThrow 68 / 122
  60. 185.

    Можно включить логи и узнать что JIT думает про код

    -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation 69 / 122
  61. 186.

    Можно включить логи и узнать что JIT думает про код

    -XX:+UnlockDiagnosticVMOptions -XX:+LogCompilation -XX:LogFile=compiler_app1.log 69 / 122
  62. 187.
  63. 188.
  64. 190.

    попытались выполнить неизвестный код <uncommon_trap thread='140499419600640' reason='range_check' action='none' compile_id='249830' compiler='C2'

    level='4' count='-1' state='range_check recompiled' recompiles2='1' stamp='37490.529'> <jvms bci='11' method='com/...'/> 71 / 122
  65. 192.

    местоположение плохого кода <uncommon_trap thread='140499419600640' <jvms bci='11' method='com/...'/> reason='range_check' action='none'

    compile_id='249830' compiler='C2' level='4' count='-1' state='range_check recompiled' recompiles2='1' stamp='37490.529'> 71 / 122
  66. 195.

    Но каждый метод компилируется лишь дважды? catch блок может быть

    не один Метод мог встроиться (inline) в множество других 72 / 122
  67. 196.

    Но каждый метод компилируется лишь дважды? catch блок может быть

    не один Метод мог встроиться (inline) в множество других И можно получить непрерывные uncommon_trap'ы 72 / 122
  68. 199.

    java -Xmx4g ...; top PID PR VIRT RES %CPU %MEM

    TIME+ COMMAND 45120 20 8,4g 5g 100 7,0 367:22 java 45122 20 9,0g 5g 46 7,0 767:32 java 45123 20 9,0g 5g 0 7,0 350:00 java 74 / 122
  69. 200.

    java -Xmx4g ...; top PID PR VIRT RES %CPU %MEM

    TIME+ COMMAND 45120 20 8,4g 7g 100 7,0 369:22 java 45122 20 9,0g 5g 46 7,0 767:32 java 45123 20 9,0g 5g 0 7,0 350:00 java 74 / 122
  70. 201.

    java -Xmx4g ...; top PID PR VIRT RES %CPU %MEM

    TIME+ COMMAND 45120 20 8,4g 9g 100 7,0 371:22 java 45122 20 9,0g 5g 46 7,0 767:32 java 45123 20 9,0g 5g 0 7,0 350:00 java Ааааа! 74 / 122
  71. 202.

    java -Xmx4g ...; top PID PR VIRT RES %CPU %MEM

    TIME+ COMMAND 45120 20 8,4g 11g 100 7,0 373:22 java 45122 20 9,0g 5g 46 7,0 767:32 java 45123 20 9,0g 5g 0 7,0 350:00 java Аааааа! 74 / 122
  72. 203.

    java -Xmx4g ...; top PID PR VIRT RES %CPU %MEM

    TIME+ COMMAND 45120 20 8,4g 13g 100 7,0 375:22 java 45122 20 9,0g 5g 46 7,0 767:32 java 45123 20 9,0g 5g 0 7,0 350:00 java Жмём Shift + H ! 74 / 122
  73. 210.

    Thread 19 (Thread 0x7faf333c9700 (LWP 14622)): #0 0x00007faf5ac836d5 in pthread_cond_wait@@GLIBC_2.3.2

    () from /lib64/libpthread.so.0 #1 0x00007faf59dcb42b in os::PlatformEvent::park() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59daf9f5 in ObjectMonitor::wait(long, bool, Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59ba9638 in JVM_MonitorWait () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf45af16c7 in ?? () #5 0x00007faf38670938 in ?? () #6 0x00007faf5678c000 in ?? () #7 0x00007faf40412b78 in ?? () #8 0x00007faf333c8868 in ?? () #9 0x00007faf404129f8 in ?? () #10 0x00007faf333c88d8 in ?? () #11 0x00007faf404be378 in ?? () #12 0x0000000000000000 in ?? () Thread 18 (Thread 0x7faf38492700 (LWP 14620)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dcbb6a in Parker::park(bool, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59f585fb in Unsafe_Park () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf45bff92a in ?? () #4 0x000000044008e120 in ?? () #5 0x00007faf55d03000 in ?? () #6 0x00007faf38491850 in ?? () #7 0x00007faf5a5a789d in __vsnprintf_chk () from /lib64/libc.so.6 #8 0x00000007c00117a8 in ?? () #9 0x000000044007c3c0 in ?? () #10 0x8800f85a880bd9be in ?? () #11 0x0000000000000000 in ?? () ---Type <return> to continue, or q <return> to quit--- Thread 17 (Thread 0x7faf3899b700 (LWP 14619)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dc10d7 in os::PlatformEvent::park(long) [clone .part.33] () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80df4 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d8226a in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59f2395a in WatcherThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #7 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #8 0x0000000000000000 in ?? () Thread 16 (Thread 0x7faf38a9c700 (LWP 14618)): #0 0x00007faf5ac836d5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dcb42b in os::PlatformEvent::park() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80d09 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d8226a in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59e72081 in ServiceThread::service_thread_entry(JavaThread*, Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #9 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #10 0x0000000000000000 in ?? () Thread 15 (Thread 0x7faf38d9d700 (LWP 14617)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dc10d7 in os::PlatformEvent::park(long) [clone .part.33] () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80df4 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d822ae in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf5993cb7f in CompileQueue::get() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf5994544b in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #10 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #11 0x0000000000000000 in ?? () Thread 14 (Thread 0x7faf38e9e700 (LWP 14616)): #0 0x00007faf59d9dceb in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #1 0x00007faf59e1900e in PhaseIterGVN::remove_globally_dead_node(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59e19e0a in PhaseIterGVN::subsume_node(Node*, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59cbe4e1 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59ca9234 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59ca99e2 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59ca6c1f in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59cb5a49 in PhaseIdealLoop::build_and_optimize(bool, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59936c8b in Compile::Optimize() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5993873a in Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #10 0x00007faf5987d61a in C2Compiler::compile_method(ciEnv*, ciMethod*, int) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #11 0x00007faf59943d7c in CompileBroker::invoke_compiler_on_method(CompileTask*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #12 0x00007faf59945998 in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #13 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #14 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #15 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #16 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 ---Type <return> to continue, or q <return> to quit--- #17 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #18 0x0000000000000000 in ?? () Thread 13 (Thread 0x7faf38f9f700 (LWP 14615)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dc10d7 in os::PlatformEvent::park(long) [clone .part.33] () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80df4 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d822ae in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf5993cb7f in CompileQueue::get() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf5994544b in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #10 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #11 0x0000000000000000 in ?? () Thread 12 (Thread 0x7faf392d0700 (LWP 14614)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dcbb6a in Parker::park(bool, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59f585fb in Unsafe_Park () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf45bff92a in ?? () #4 0x000000044008e120 in ?? () #5 0x000000044009f000 in ?? () #6 0x00000004400a43e8 in ?? () #7 0x00007faf55137800 in ?? () #8 0x00007faf392cf9e0 in ?? () #9 0x00007faf59dc3733 in os::javaTimeMillis() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #10 0x00007faf4be75a90 in ?? () #11 0x000000044009f000 in ?? () #12 0x0000016881b9f729 in ?? () #13 0x0000016800000005 in ?? () #14 0x000000044009f178 in ?? () #15 0x053fe6c900000950 in ?? () #16 0x0000016881f0a7ad in ?? () #17 0x000000044009f184 in ?? () #18 0x000000000150c16b in ?? () #19 0x00000004400a43e8 in ?? () #20 0x00000004400a43e8 in ?? () #21 0xdeaddeaf00000000 in ?? () #22 0xdeaddeaf00000005 in ?? () #23 0x00007faf392cfad0 in ?? () #24 0x00007faf45ad97a7 in ?? () #25 0x000000044009f000 in ?? () #26 0x000000044009f000 in ?? () #27 0x0000000000001fa0 in ?? () #28 0x00007faf409b5050 in ?? () #29 0x00007faf392cfcb0 in ?? () #30 0x00007faf392cfb70 in ?? () #31 0x00007faf55137800 in ?? () #32 0x00007faf55137800 in ?? () #33 0x00007faf392cfb70 in ?? () #34 0x00007faf392cfd58 in ?? () #35 0x00007faf0000000a in ?? () #36 0x00007faf409b5050 in ?? () #37 0x00007faf45aec600 in ?? () #38 0x00007faf392cfcb8 in ?? () 77 / 122
  74. 211.

    #0 0x00007faf5ac836d5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dcb42b in

    os::PlatformEvent::park() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80d09 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d8226a in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59e72081 in ServiceThread::service_thread_entry(JavaThread*, Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #9 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #10 0x0000000000000000 in ?? () Thread 15 (Thread 0x7faf38d9d700 (LWP 14617)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dc10d7 in os::PlatformEvent::park(long) [clone .part.33] () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80df4 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d822ae in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf5993cb7f in CompileQueue::get() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf5994544b in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #10 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #11 0x0000000000000000 in ?? () Thread 14 (Thread 0x7faf38e9e700 (LWP 14616)): #0 0x00007faf59d9dceb in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #1 0x00007faf59e1900e in PhaseIterGVN::remove_globally_dead_node(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59e19e0a in PhaseIterGVN::subsume_node(Node*, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59cbe4e1 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59ca9234 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59ca99e2 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59ca6c1f in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59cb5a49 in PhaseIdealLoop::build_and_optimize(bool, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59936c8b in Compile::Optimize() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5993873a in Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #10 0x00007faf5987d61a in C2Compiler::compile_method(ciEnv*, ciMethod*, int) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #11 0x00007faf59943d7c in CompileBroker::invoke_compiler_on_method(CompileTask*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #12 0x00007faf59945998 in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #13 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #14 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #15 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #16 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 ---Type <return> to continue, or q <return> to quit--- #17 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #18 0x0000000000000000 in ?? () Thread 13 (Thread 0x7faf38f9f700 (LWP 14615)): #0 0x00007faf5ac83a82 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0 #1 0x00007faf59dc10d7 in os::PlatformEvent::park(long) [clone .part.33] () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59d80df4 in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59d822ae in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf5993cb7f in CompileQueue::get() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf5994544b in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59f2ff9b in JavaThread::thread_main_inner() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59dc2c92 in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 77 / 122
  75. 212.

    /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59f3022f in JavaThread::run() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59dc2c92

    in java_start(Thread*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #9 0x00007faf5ac7fdc5 in start_thread () from /lib64/libpthread.so.0 #10 0x00007faf5a593c4d in recvmmsg () from /lib64/libc.so.6 #11 0x0000000000000000 in ?? () Thread 14 (Thread 0x7faf38e9e700 (LWP 14616)): #0 0x00007faf59d9dceb in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #1 0x00007faf59e1900e in PhaseIterGVN::remove_globally_dead_node(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #2 0x00007faf59e19e0a in PhaseIterGVN::subsume_node(Node*, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #3 0x00007faf59cbe4e1 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #4 0x00007faf59ca9234 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #5 0x00007faf59ca99e2 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #6 0x00007faf59ca6c1f in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #7 0x00007faf59cb5a49 in PhaseIdealLoop::build_and_optimize(bool, bool) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so #8 0x00007faf59936c8b in Compile::Optimize() () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so 77 / 122
  76. 213.

    Unique_Node_List::remove(Node*) PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*, Node*) PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_

    PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) PhaseIdealLoop::build_and_optimize(bool, bool) Compile::Optimize() Compile::Compile(ciEnv* C2Compiler* ciMethod* int bool bool 78 / 122
  77. 214.

    запуск потока CompileBroker::invoke_compiler_on_method(CompileTask*) q _ _ ( ) PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*,

    Node*) PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_ PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) PhaseIdealLoop::build_and_optimize(bool, bool) Compile::Optimize() Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool C2Compiler::compile_method(ciEnv*, ciMethod*, int) 78 / 122
  78. 215.

    вот, вот компилятор моей мечты! l l h d( h

    d ) Unique_Node_List::remove(Node*) PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*, Node*) PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_ PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) PhaseIdealLoop::build_and_optimize(bool, bool) Compile::Optimize() Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool 78 / 122
  79. 216.

    он компилирует! Compile::Optimize() Unique_Node_List::remove(Node*) PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*, Node*) PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int,

    Node* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_ PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) PhaseIdealLoop::build_and_optimize(bool, bool) 78 / 122
  80. 217.

    непереводимая игра слов PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*, Node*) PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*

    PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_ PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) Unique_Node_List::remove(Node*) IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) 78 / 122
  81. 218.

    берём первое попавшееся слово PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) Unique_Node_List::remove(Node*) PhaseIterGVN::remove_globally_dead_node(Node*) PhaseIterGVN::subsume_node(Node*, Node*)

    PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node* PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_ IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) 78 / 122
  82. 221.
  83. 233.

    core dump — снимок всей памяти JVM Вместе с хипом

    Вместе с паролями В любой непонятной ситуации снимай core dump 83 / 122
  84. 237.
  85. 238.

    $ gcore -o core.dump 42 Saved corefile core.dump $ gdb

    $JAVA_HOME/bin/java Reading symbols from .../bin/java... Missing separate debuginfo for /usr/java/jdk1.8.0_191/bin/java (no debugging symbols found)...done. [New LWP 14600] [New LWP 14601] 85 / 122
  86. 240.

    (gdb) info threads ... 14 Thread 0x7faf38e9e700 (LWP 14616) 0x7faf59d9dceb

    in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so ... 86 / 122
  87. 241.

    (gdb) info threads ... 14 Thread 0x7faf38e9e700 (LWP 14616) 0x7faf59d9dceb

    in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so ... 86 / 122
  88. 242.

    (gdb) info threads ... 14 Thread 0x7faf38e9e700 (LWP 14616) 0x7faf59d9dceb

    in Unique_Node_List::remove(Node*) () from /usr/java/jdk1.8.0_191/jre/lib/amd64/server/libjvm.so ... 86 / 122
  89. 244.

    (gdb) thread 14 [Switching to thread 14 (Thread 0x7faf38e9e700 (LWP

    14616))] #0 0x7faf59d9dceb in Unique_Node_List::remove(Node*) () 87 / 122
  90. 246.

    (gdb) bt #0 in Unique_Node_List::remove(Node*) #1 in PhaseIterGVN::remove_globally_dead_node(Node*) #2 in

    PhaseIterGVN::subsume_node(Node*, Node*) #3 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) #4 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) #5 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) #6 in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) #7 in PhaseIdealLoop::build_and_optimize(bool, bool) #8 i C il ::O ti i () 88 / 122
  91. 247.

    (gdb) bt #4 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) #5 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&)

    #6 in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) #7 in PhaseIdealLoop::build_and_optimize(bool, bool) #8 in Compile::Optimize() #9 in Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool, bool) #10 in C2Compiler::compile_method(ciEnv*, ciMethod*, int) #11 in CompileBroker::invoke_compiler_on_method(CompileTask*) #12 in CompileBroker::compiler thread loop() 88 / 122
  92. 248.

    (gdb) bt #9 in Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, bool, bool,

    bool) #10 in C2Compiler::compile_method(ciEnv*, ciMethod*, int) #11 in CompileBroker::invoke_compiler_on_method(CompileTask*) #12 in CompileBroker::compiler_thread_loop() #13 in JavaThread::thread_main_inner() 88 / 122
  93. 249.

    (gdb) bt #0 in Unique_Node_List::remove(Node*) #1 in PhaseIterGVN::remove_globally_dead_node(Node*) #2 in

    PhaseIterGVN::subsume_node(Node*, Node*) #3 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) #4 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) #5 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) #6 in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) #7 in PhaseIdealLoop::build_and_optimize(bool, bool) #8 i C il ::O ti i () 88 / 122
  94. 250.

    (gdb) bt #0 in Unique_Node_List::remove(Node*) #1 in PhaseIterGVN::remove_globally_dead_node(Node*) #2 in

    PhaseIterGVN::subsume_node(Node*, Node*) #3 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) #4 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) #5 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) #6 in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) #7 in PhaseIdealLoop::build_and_optimize(bool, bool) #8 i C il ::O ti i () 88 / 122
  95. 251.

    (gdb) bt #0 in Unique_Node_List::remove(Node*) #1 in PhaseIterGVN::remove_globally_dead_node(Node*) #2 in

    PhaseIterGVN::subsume_node(Node*, Node*) #3 in PhaseIdealLoop::clone_loop(IdealLoopTree*, Node_List&, int, Node*) #4 in PhaseIdealLoop::create_slow_version_of_loop(IdealLoopTree*, Node_List&) #5 in PhaseIdealLoop::do_unswitching(IdealLoopTree*, Node_List&) #6 in IdealLoopTree::iteration_split(PhaseIdealLoop*, Node_List&) #7 in PhaseIdealLoop::build_and_optimize(bool, bool) #8 i C il ::O ti i () 88 / 122
  96. 256.

    (gdb) frame 10 #10 0x00007faf5987d61a in C2Compiler::compile_method(ciEnv*, ciMethod*, int) (gdb)

    info args No symbol table info available (gdb) Где аргументы-то? 89 / 122
  97. 257.

    $ gdb $JAVA_HOME/bin/java Reading symbols from .../bin/java... Missing separate debuginfo

    for /usr/java/jdk1.8.0_191/bin/java (no debugging symbols found)...done. [New LWP 14600] [New LWP 14601] 90 / 122
  98. 258.

    $ gdb $JAVA_HOME/bin/java Reading symbols from .../bin/java... Missing separate debuginfo

    for /usr/java/jdk1.8.0_191/bin/java (no debugging symbols found)...done. [New LWP 14600] [New LWP 14601] 90 / 122
  99. 262.

    (gdb) info registers ... esp 0xeeefa4f0 0xeeefa4f0 ... (gdb) x/10x

    $esp 0xeeefa4f0: 0xeeefa55c 0xeeefacf4 0xef2ab878 0x096fe388 0xeeefa500: 0xffffffff 0x00000001 0x00000001 0x00000001 0xeeefa510: 0x0120ba85 0xeeefab20 91 / 122
  100. 268.

    CLHSDB крутой отладчик в Java 9+ Но в Java 8

    его же нет Но когда нас это останавливало? 95 / 122
  101. 278.

    hsdb> inspect 0x096fe388 Type is ciMethod (size of 100) uint

    ciBaseObject::_ident: 1670 Metadata* ciMetadata::_metadata: Metadata @ 0xedaab218 int ciMethod::_interpreter_invocation_count: 31298 int ciMethod::_interpreter_throwout_count: 0 int ciMethod::_instructions_size: -1 98 / 122
  102. 279.

    class ciMethod : public ciMetadata { ... private: // General

    method information. ciFlags _flags; ciSymbol* _name; ciInstanceKlass* _holder; ciSignature* _signature; 99 / 122
  103. 280.

    Мы ищем название метода и класса ciSymbol* _name; ciInstanceKlass* _holder;

    class ciMethod : public ciMetadata { ... private: // General method information. ciFlags _flags; ciSignature* _signature; 99 / 122
  104. 287.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> 102 / 122
  105. 288.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> 102 / 122
  106. 289.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> symbol 0xee1ef060 102 / 122
  107. 290.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> symbol 0xee1ef060 102 / 122
  108. 291.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> symbol 0xee1ef060 #forMethodParameter 102 / 122
  109. 292.

    hsdb> inspect 0x096fe3f0 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee1ef060 hsdb> symbol 0xee1ef060 #forMethodParameter 102 / 122
  110. 294.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> 103 / 122
  111. 295.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> 103 / 122
  112. 296.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> symbol 0xee0a0e80 103 / 122
  113. 297.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> symbol 0xee0a0e80 103 / 122
  114. 298.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> symbol 0xee0a0e80 #org/springframework/core/ResolvableType 103 / 122
  115. 299.

    hsdb> inspect 0x096fe378 Type is ciSymbol (size of 16) Symbol*

    ciSymbol::_symbol: Symbol @ 0xee0a0e80 hsdb> symbol 0xee0a0e80 #org/springframework/core/ResolvableType 103 / 122
  116. 309.
  117. 320.

    Replay jars Встроеный в OpenJDK механизм Создаёт jar файл с

    фактическими классами Берём и воспроизводим 112 / 122
  118. 326.
  119. 327.

    JIT компилятору нужно знать Сколько раз вызывались методы Какие классы

    где использовались Что куда инлайнить Это всё тоже попадает в replay jars! 114 / 122
  120. 330.

    Заводим replay jars hsdb> dumpreplaydata # сохраняем JIT профиль hsdb>

    buildreplayjars all # и классы $ java -XX:+ReplayCompiles -XX:+ReplayIgnoreInitErrors -XX:+PrintCompilation -XX:ReplayDataFile=/tmp/replay_pid480.log 115 / 122
  121. 331.

    Exception in thread "main" java.lang.InternalError at sun.jvm.hotspot.tools.jcore.ClassWriter .writeIndex(ClassWriter.java:106) at sun.jvm.hotspot.tools.jcore.ClassWriter

    .writeMethod(ClassWriter.java:550) at sun.jvm.hotspot.tools.jcore.ClassWriter .writeMethods(ClassWriter.java:431) 116 / 122
  122. 332.

    Exception in thread "main" java.lang.InternalError at sun.jvm.hotspot.tools.jcore.ClassWriter .writeIndex(ClassWriter.java:106) at sun.jvm.hotspot.tools.jcore.ClassWriter

    .writeMethod(ClassWriter.java:550) at sun.jvm.hotspot.tools.jcore.ClassWriter .writeMethods(ClassWriter.java:431) 116 / 122
  123. 333.

    Exception in thread "main" java.lang.InternalError at sun.jvm.hotspot.tools.jcore.ClassWriter .writeIndex(ClassWriter.java:106) at sun.jvm.hotspot.tools.jcore.ClassWriter

    .writeMethod(ClassWriter.java:550) at sun.jvm.hotspot.tools.jcore.ClassWriter .writeMethods(ClassWriter.java:431) 116 / 122
  124. 351.

    Выводы Ищите строку compilation stopped в stdout Следите за размером

    CodeCache (~JMX) Если компилятору плохо — можно и отключить 121 / 122
  125. 352.

    Выводы Ищите строку compilation stopped в stdout Следите за размером

    CodeCache (~JMX) Если компилятору плохо — можно и отключить В любой непонятной ситуации снимайте coredump и заводите тикеты на OpenJDK 121 / 122