RFR: 8364927: Add @requires annotation to TestReclaimStringsLeaksMemory.java [v2]

Stefan Karlsson stefank at openjdk.org
Wed Sep 3 09:50:44 UTC 2025


On Wed, 3 Sep 2025 08:00:06 GMT, jonghoonpark <duke at openjdk.org> wrote:

>> test/hotspot/jtreg/gc/stress/TestReclaimStringsLeaksMemory.java line 38:
>> 
>>> 36: 
>>> 37: /*
>>> 38:  * @test TestReclaimStringsLeaksMemorySerial
>> 
>> In other tests we set the id instead. For example, in the TestSystemGC we have:
>> 
>>  * @test id=Serial
>> 
>> 
>> Maybe do the same for this test?
>
> Thank you for your feedback.
> 
> Then, would modifying the code as shown below be acceptable?
> 
> 
> /*
>  * @test TestReclaimStringsLeaksMemory
>  * ...
>  * @run driver/timeout=480 gc.stress.TestReclaimStringsLeaksMemory
>  */
> 
> /*
>  * @test id=Serial
>  * ...
>  * @run driver/timeout=480 gc.stress.TestReclaimStringsLeaksMemory -XX:+UseSerialGC
>  */
> 
> /*
>  * @test id=Parallel
>  * ...
>  * @run driver/timeout=480 gc.stress.TestReclaimStringsLeaksMemory -XX:+UseParallelGC
>  */
> 
> /*
>  * @test id=G1
>  * ...
>  * @run driver/timeout=480 gc.stress.TestReclaimStringsLeaksMemory -XX:+UseG1GC
>  */

Do you really need the first one? It will cause us to run G1 twice. If you really need it I would prefer if you used id= and gave it a proper id. Otherwise the run will just say TestReclaimStringsLeaksMemory#id0

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26766#discussion_r2318419744


More information about the hotspot-gc-dev mailing list