RFR: 8343893: Test jdk/jfr/event/runtime/TestNativeMemoryUsageEvents.java failed: heap should have grown and NMT should show that: expected 0 > 0 [v3]

Leonid Mesnik lmesnik at openjdk.org
Mon Nov 18 16:19:51 UTC 2024


On Mon, 18 Nov 2024 12:42:14 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> # Background
>> 
>> With the implementation of [JDK-8312132](https://bugs.openjdk.org/browse/JDK-8312132) we added the `MemoryFileTracker` (MFT). Unfortunately, this work failed to implement JFR integration. This, in turn, meant that (generational) ZGC has not correctly reported its heap usage via the NMT JFR events. We (as in Oracle) never saw this issue in testing, as we didn't run this test for all possible GC configurations. With an update of our test configurations this is no longer the case: We run this test for all possible GCs and the test now fails for generational ZGC.
>> 
>> # The fix
>> 
>> I implemented JFR events for the MFT by adding all of its reserved and committed memory into the JFR data, similarly to the `VirtualMemoryTracker`. I also added an explicit `run` using `ZGC` to the failing test, to ensure that any actual regressions are found.
>
> Johan Sjölen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Un-problemlist the test
>  - Merge remote-tracking branch 'openjdk/master' into mft-jfr
>  - Add include
>  - Add MemoryFileTracker support to NMTUsage

Changes requested by lmesnik (Reviewer).

test/jdk/jdk/jfr/event/runtime/TestNativeMemoryUsageEvents.java line 47:

> 45:  * @modules jdk.jfr
> 46:  *          jdk.management
> 47:  * @run main/othervm -XX:+UseZGC -XX:NativeMemoryTracking=summary -Xms16m -Xmx128m -XX:-UseLargePages -Xlog:gc jdk.jfr.event.runtime.TestNativeMemoryUsageEvents true

It is not needed, we'll catch them anyway. But if you want to add separate run, please add it as a separate testcase and requires vm.gc.G1.
So we have separate test results and can run tests with any GC.

-------------

PR Review: https://git.openjdk.org/jdk/pull/22204#pullrequestreview-2443100829
PR Review Comment: https://git.openjdk.org/jdk/pull/22204#discussion_r1846881639


More information about the hotspot-jfr-dev mailing list