On Wed, 29 Oct 2025 03:55:41 GMT, SendaoYan <[email protected]> wrote:

>> Hi all,
>> 
>> We observed the test 
>> vmTestbase/nsk/jvmti/AttachOnDemand/attach020/TestDescription.java 
>> intermittent fails. since the target application intermittent OOM. The 
>> target application will try to exhaust the heap memory and then trigger 
>> garbage collection by `ClassUnloader.eatMemory()` in file 
>> test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach020/attach020Target.java.
>> 
>> So I think it's better to limited the max heap usage of target application. 
>> Before this PR, the physical memory usage is about 30.7GB(this depends the 
>> total free memory on the test machine), and the jtreg main action take about 
>> 11 seconds to finish; After this PR, the physical memory usage is about 
>> 126MB, and the jtreg main action take about 0.7 senonds to finish. I use 
>> below command to get the usage of physical memory.
>> 
>> Change has been verified locally, test-fix only, no risk.
>> 
>> 
>> grep VmRSS /proc/`ps -ef | grep -w java | grep vmsqe.aod.AppId | awk '{print 
>> $2}'`/status
>
> SendaoYan has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update the test description

Changes requested by lmesnik (Reviewer).

test/hotspot/jtreg/vmTestbase/gc/gctests/SoftReference/soft003/soft003.java 
line 2:

> 1: /*
> 2:  * Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights 
> reserved.

Only copyright changes in this file.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach020/TestDescription.java
 line 57:

> 55:  *      -jdk ${test.jdk}
> 56:  *      -target nsk.jvmti.AttachOnDemand.attach020.attach020Target
> 57:  *      -javaOpts="-XX:+UsePerfData -Xmx128M ${test.vm.opts} 
> ${test.java.opts} -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 
> -XX:+WhiteBoxAPI"

Please remove Xmx128M in all tests, it is not needed now.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach021/TestDescription.java
 line 53:

> 51:  *      -jdk ${test.jdk}
> 52:  *      -target nsk.jvmti.AttachOnDemand.attach021.attach021Target
> 53:  *      -javaOpts="-XX:+UsePerfData -Xmx128M ${test.vm.opts} 
> ${test.java.opts} -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions 
> -XX:+WhiteBoxAPI"

Please remove Xmx128M, it is not needed now.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GarbageCollectionStart/gcstart001.java 
line 68:

> 66:     private int runThis(String argv[], PrintStream out) {
> 67:         try {
> 68:             for (int i=0; i<ITERATIONS; i++)

The loop and try//catch are not needed anymore.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/GarbageCollectionStart/gcstart002.java 
line 66:

> 64:         try {
> 65:             for (int i=0; i<ITERATIONS; i++)
> 66:                 ClassUnloader.eatMemory(); // provoke garbage collecting

The loop and try//catch are not needed anymore.

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP12/ap12t001.java 
line 75:

> 73:         // Provoke OutOfMemoryError in order to clear all soft references
> 74:         for (int i= 0; i < GC_TRYS; i++)
> 75:             ClassUnloader.eatMemory();

loop is not needed, I think

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

PR Review: https://git.openjdk.org/jdk/pull/28011#pullrequestreview-3391592901
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471667879
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471667402
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471668298
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471669523
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471670038
PR Review Comment: https://git.openjdk.org/jdk/pull/28011#discussion_r2471670896

Reply via email to