RFR: 8330849: Add test to verify memory usage with recursive locking [v2]

Leonid Mesnik lmesnik at openjdk.org
Tue Apr 23 18:59:27 UTC 2024


On Tue, 23 Apr 2024 05:40:49 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/locking/TestRecursiveMonitorChurn.java line 35:
>> 
>>> 33:  * @summary Tests that recursive locking doesn't cause excessive native memory usage
>>> 34:  * @library /test/lib
>>> 35:  * @run main TestRecursiveMonitorChurn
>> 
>> Better to use 
>> @run driver TestRecursiveMonitorChurn
>> for tests which fork VM.
>
> Ok, did that. Can you explain to me what difference does it make?

The 'driver' code is executed without any additional VM options. So it just runs faster then main.
See doc: https://openjdk.org/jtreg/tag-spec.html

`
driver[/fail][/timeout=<seconds>] <class> <arg>*
Invoke the main method of the specified class, passing any arguments after the class name. Although superficially similar to @run main, this is for use when it is desirable to perform additional setup or configuration before running the class containing the actual test code, possibly in a child VM.

The named <class> will be compiled on demand, just as though an "@run build <class>" action had been inserted before this action. If this action requires classes other than <class> to be up to date, insert an appropriate build action before this action.
`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18899#discussion_r1576759609


More information about the hotspot-runtime-dev mailing list