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

The Method counter fields used for profiling can be allocated lazily

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: hs25
    • Component/s: embedded
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b29
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        The following 7 Method fields are used for interpreter/tiered compilation profiling. These fields are not used until a java method is executed.

          int _interpreter_invocation_count;
          u2 _interpreter_throwout_count;
          u2 _number_of_breakpoints;
          InvocationCounter _invocation_counter;
          InvocationCounter _backedge_counter;
        #ifdef TIERED
          float _rate;
          jlong _prev_time;
        #endif

        Move those fields into a separate MethodCounters object referenced from Method. The counter object for a specific method can be allocated upon the first time when any of the fields is modified.

        A separate data structer is used for the interpreter counters instead of adding the counters to MethodData, because the MethodData might not have the same life span as the interpreter counters. For example when TieredCompilation is not enabled, the MethodData is not allocated until the interpreter counter reaches InterpreterProfileLimit. Allocating the MethodData early would waste memory for non-hot methods which only execute a few times. Also the MethodData is only allocated when ProfileInterpreter is enabled, which is the default case for c2 but not for c1. Under TieredCompilation, there are cases where MethodData exist but the interpreter counters are never accessed.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jiangli Jiangli Zhou
                  Reporter:
                  jiangli Jiangli Zhou
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: