<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hello, I don't think this is as harmful as you have assumed.</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
The way CDS tests work (taking runtime/cds/appcds/aotCache/HelloAOTCache.java for example) is that the tests themselves are just drivers to execute jar applications (because CDS only works for jar applications). test.cds.runtime.options system property is only
provided when running customized runtime/cds tests so flags can be passed to child vms, and all those tests anticipate vm.gc to indicate the gc for the child vm spawned by the driver.</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
In conclusion, I don't think a rename would be necessary, as I don't see a scenario where the driver itself would care about its own gc in addition to the child process gc.</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
CC'ing Ioi as Ioi is the main CDS area maintainer.</div>
<div style="font-family: "Calibri Light", "Helvetica Light", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
Chen</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> hotspot-dev <hotspot-dev-retn@openjdk.org> on behalf of Guoxiong Li <lgxbslgx@gmail.com><br>
<b>Sent:</b> Saturday, August 30, 2025 5:40 AM<br>
<b>To:</b> hotspot-gc-dev@openjdk.org <hotspot-gc-dev@openjdk.org>; hotspot-runtime-dev@openjdk.org <hotspot-runtime-dev@openjdk.org>; hotspot-dev@openjdk.org <hotspot-dev@openjdk.org><br>
<b>Subject:</b> [Question] The property `vm.gc` in jtreg test</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
<div id="x_gmail-:33e" class="x_gmail-Am x_gmail-aiL x_gmail-Al x_editable x_gmail-LW-avf x_gmail-tS-tW x_gmail-tS-tY" aria-label="Message Body" role="textbox" tabindex="1" style="direction:ltr; min-height:376px">
Hi all,
<div><br>
</div>
<div>I notice the meaning of the test property `vm.gc` is not clear. </div>
<div>The method `VMProps::vmGCforCDS` (shown below, in directory: test/jtreg-ext/requires/VMProps.java) </div>
<div>extracts the property `vm.gc` from the option `test.cds.runtime.options`. </div>
<div>So the current `vm.gc` is about both CDS and GC, not only the GC.<br>
I propose changing the current test property name `vm.gc` to `vm.gc.cds` or `vm.cds.gc`.</div>
<div>
<div><br class="x_gmail-Apple-interchange-newline">
Waiting for your opinion. Any ideas will be appreciated.</div>
<div><br>
</div>
</div>
<div>```java<br>
/**<br>
* "jtreg -vmoptions:-Dtest.cds.runtime.options=..." can be used to specify<br>
* the GC type to be used when running with a CDS archive. Set "vm.gc" accordingly,<br>
* so that tests that need to explicitly choose the GC type can be excluded<br>
* with "@requires vm.gc == null".<br>
*<br>
* @param map - property-value pairs<br>
*/<br>
protected void vmGCforCDS(SafeMap map) {<br>
if (!GC.isSelectedErgonomically()) {<br>
// The GC has been explicitly specified on the command line, so<br>
// jtreg will set the "vm.gc" property. Let's not interfere with it.<br>
return;<br>
}<br>
<br>
String jtropts = System.getProperty("test.cds.runtime.options");<br>
if (jtropts != null) {<br>
for (String opt : jtropts.split(",")) {<br>
if (opt.startsWith(GC_PREFIX) && opt.endsWith(GC_SUFFIX)) {<br>
String gc = opt.substring(GC_PREFIX.length(), opt.length() - GC_SUFFIX.length());<br>
map.put("vm.gc", () -> gc);<br>
}<br>
}<br>
}<br>
}<br>
</div>
<div>```</div>
<div><br>
</div>
<div>Best Regards,</div>
<div>-- Guoxiong</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>