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

Array Elements in OldObjectSample event has the incorrect description

XMLWordPrintable

    • jfr
    • b10
    • generic
    • generic

        The value of "arrayElements" which is a field of "OldObjectSample" of JFR event is different from the description.

        The description attribute of "arrayElements" is below.
        "If the object is an array, the number of elements, or -1 if it is not an array"
        https://github.com/openjdk/jdk/blob/a9d21c61fb12a11e18c6bb8aa903e5a8e42473f1/src/hotspot/share/jfr/metadata/metadata.xml#L743
        This description is returned by ValueDescriptor.getDescription().

        But actually, if the object is not an array, "arrayElements" is -2147483648, or INT_MIN.

        RecordedEvent.toString() outputs N/A if the field value is INT_MIN.

        jdk.OldObjectSample {
          startTime = 10:42:35.890 (2023-07-19)
          allocationTime = 10:42:35.872 (2023-07-19)
          objectSize = 24 bytes
          objectAge = 18.1 ms
          lastKnownHeapUsage = 512.0 kB
          object = [
            java.lang.String
          ]
          arrayElements = N/A
          root = N/A
          eventThread = "main" (javaThreadId = 1)
        }

        However, RecordedEvent.getValue("arrayElements") outputs -2147483648. Also, "arrayElements" is displayed as -2147483648 on the JMC browser.
        This result is different from the description of OldObjectSample.

              tkiriyama Takuya Kiriyama
              tkiriyama Takuya Kiriyama
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: