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

Sampling interval not always correct

    Details

    • Subcomponent:
    • Resolved In Build:
      b19
    • CPU:
      x86_64
    • OS:
      linux

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Tested with Java 11.0.1 and 12-ea+23 on Linux and Windows.

      A DESCRIPTION OF THE PROBLEM :
      When large arrays are allocated, subsequent SampledObjectAlloc events are missing with SetHeapSamplingInterval set to 0.

      When the same arrays are small, all allocations are reported as expected.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Attached is a sample that does a warmup first to avoid hitting internal data structure updates after SetHeapSamplingInterval was called.

      It compares small and large array allocations.

      Start with

      gcc -shared -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -fPIC HeapTest.c -o libHeapTest.so
      LD_LIBRARY_PATH=. $JAVA_HOME/bin/java -agentlib:HeapTest HeapTest.java



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Test case should record 10.000 allocations when small and large arrays are allocated and return 0.
      ACTUAL -
      Test case records 10.000 allocations when small arrays are allocated and around 150 with large arrays and returns 1.

      ---------- BEGIN SOURCE ----------
      Find Attachment
      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              jcbeyler Jean Christophe Beyler
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: