JDK-8202567 : 100% public JVMTI event and API coverage
Type:Sub-task
Component:other-libs
Priority:P4
Status:Resolved
Resolution:Fixed
Submitted:2018-05-03
Updated:2018-05-18
Resolved:2018-05-18
Description
JEP 331 adds two elements in the JVMTI: a SetSamplingHeapRate method and a callback for heap allocation sampling system.
The following item shows how the two elements are being covered at a 100%
Comments
JEP 331 adds two methods to the JVMTI Spec:
- SetSamplingRate is tested explicitly via:
- HeapMonitorStatRateTest.java, which tests various sampling rates
- HeapMonitorArrayAllSampledTest.java which tests all allocations being sampled
- HeapMonitorStatArrayCorrectnessTest.java, which tests various array sizes with a given sampling rate
- HeapMonitorStatObjectCorrectnessTest.java, which tests one sampling rate with a given "big" object
- HeapMonitorIllegalArugmentTest.java tests the negative values and checks it fails
- The callback system itself is tested via a native implementation that stores the sampled objects and their stacktraces, the correctness of both are tested via:
- HeapMonitorEventOnOffTest.java: a test that checks if the events can be turned on/off and whether callbacks happen when expected
- HeapMonitorTest.java: basic test of allocating and checking the stacktraces
- HeapMonitorGCTest.java: basic test for allocating and whether the system can detect garbage collected objects
- HeapMonitorNoCapabilityTest.java tests the case where the agent does not have the capability
- HeapMonitorTwoAgentsTest.java tests the case where a second agent tries to get the capability (enhancement will be tracked by JDK-8201654)
- HeapMonitorEventsForTwoThreadsTest.java tests the case where the agent requests the callback for two threads (enhancement will be tracked by JDK-8201655)