8382890: JcmdOnTrainingProcess.java fails Native memory tracking is not enabled

Reviewed-by: iklam, dholmes
This commit is contained in:
SendaoYan 2026-04-27 02:26:43 +00:00
parent 52ca2981a6
commit 0b1c586afa

View File

@ -38,11 +38,12 @@
* @run driver JcmdOnTrainingProcess
*/
import java.io.IOException;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.process.OutputAnalyzer;
import java.io.IOException;
import jdk.test.lib.process.ProcessTools;
public class JcmdOnTrainingProcess {
public static void main(String[] args) throws Exception {
@ -64,7 +65,8 @@ public class JcmdOnTrainingProcess {
LingeredApp.startApp(theApp,
"-cp", "LingeredApp.jar",
"-XX:AOTMode=record",
"-XX:AOTConfiguration=LingeredApp.aotconfig");
"-XX:AOTConfiguration=LingeredApp.aotconfig",
"-XX:NativeMemoryTracking=summary");
long pid = theApp.getPid();
JDKToolLauncher jcmd = JDKToolLauncher.createUsingTestJDK("jcmd");
@ -79,8 +81,8 @@ public class JcmdOnTrainingProcess {
return output;
} catch (Exception e) {
throw new RuntimeException("Test failed: " + e);
} }
catch (IOException e) {
}
} catch (IOException e) {
throw new RuntimeException("Test failed: " + e);
}
finally {