Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8066199

C2 escape analysis prevents VM from exiting quickly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 8u40, 9
    • hotspot
    • None
    • b43

        This issue may be observed with running a simple Maven command:

         $ mvn dependency:help

        Then, you may observe the significant stall after Maven completes (prints "BUILD SUCCESS" message).
        A simple profiling shows we spend most of the time after the main application thread exits in C2 compiler thread doing:

        ConnectionGraph::add_fields_to_worklist(FieldNode*,PointsToNode*) + 0x000000B4
        ConnectionGraph::add_field_uses_to_worklist(FieldNode*) + 0x00000192
        ConnectionGraph::complete_connection_graph(GrowableArray<PointsToNode*>&,GrowableArray<JavaObjectNode*>&,GrowableArray<JavaObjectNode*>&,GrowableArray<FieldNode*>&) + 0x00000488
        ConnectionGraph::compute_escape() + 0x000006EF
        ConnectionGraph::do_analysis(Compile*,PhaseIterGVN*) + 0x0000010C
        Compile::Optimize() + 0x000010BA
        Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool,bool,bool) + 0x00001088
        C2Compiler::compile_method(ciEnv*,ciMethod*,int) + 0x000001A3
        CompileBroker::invoke_compiler_on_method(CompileTask*) + 0x000008AF
        CompileBroker::compiler_thread_loop() + 0x000004E3
        JavaThread::thread_main_inner() + 0x000000E9
        java_start(Thread*) + 0x000000EF
        collector_root + 0x000001B6, line 1221 in "dispatcher.c"
        start_thread + 0x000000BA

        There are other simple commands that are affected by this, probably those long enough to kick C2 in.
        I've checked this reproduces with current jdk8u and jdk9/dev.

              kvn Vladimir Kozlov
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: