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

Sampling interval not always correct

XMLWordPrintable

    • b19
    • x86_64
    • linux

      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


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

              Created:
              Updated:
              Resolved: