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

Method compilation stops firing of hotspot:::object-alloc probes for one dimensional array allocs.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 6
    • hotspot
    • b92
    • generic
    • solaris_10
    • Verified

      hotspot:::object-alloc are not fired for one dimensional array allocations after
      method is get compiled.

      VM flavors : client | server
      VM Modes : -Xmixed | -Xcomp

      It does not work for both primitive types and objects.
      However, it does work for for multidimensional array allocations.

      Here is the result of running with -Xcomp:
      # java -XX:+UnlockDiagnosticVMOptions -XX:+PauseAtStartup -XX:+ExtendedDTraceProbes -Xcomp Main & JAVA_PID=$!
      # ./alloc.d vm.paused.$JAVA_PID -p $JAVA_PID
          method calls: 366 allocMultiDimIntArrayOf
          method calls: 366 allocOneDimIntArrayOf
          object allocs: 366 [[I

          method calls: 864 allocMultiDimIntArrayOf
          method calls: 864 allocOneDimIntArrayOf
          object allocs: 864 [[I

      No probes are fired for "[I" at all.

      Here is the result of running with -Xmixed:
      # java -XX:+UnlockDiagnosticVMOptions -XX:+PauseAtStartup -XX:+ExtendedDTraceProbes -Xmixed -XX:CompileThreshold=100 Main & JAVA_PID=$!
      # ./alloc.d vm.paused.$JAVA_PID -p $JAVA_PID
          method calls: 394 allocMultiDimIntArrayOf
          method calls: 394 allocOneDimIntArrayOf
          object allocs: 101 [I
          object allocs: 395 [[I

          method calls: 894 allocMultiDimIntArrayOf
          method calls: 894 allocOneDimIntArrayOf
          object allocs: 101 [I
          object allocs: 895 [[I

      Probes were fired only for first 101 allocations
      (before allocOneDimIntArrayOf was compiled).

      The observation from Sundar:
      It is probably related to different instructions used to allocate arrays -
      for one dimensional arrays "anewarray/newarray" is used
      and for multidimensional arrays - "multianewarray".

      Steps to reproduce (files are attached):
      1. javac Main.java
      2. java -Xcomp -XX:+UnlockDiagnosticVMOptions -XX:+PauseAtStartup -XX:+ExtendedDTraceProbes Main & JAVA_PID=$!
      3. ./alloc.d vm.paused.$JAVA_PID -p $JAVA_PID

      Thanks Amit for finding this issue.

            never Tom Rodriguez
            epavlova Ekaterina Pavlova
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: