From 8bbac984baac69defe9c3553906a145a7bedcbb1 Mon Sep 17 00:00:00 2001 From: Mike Zhang Date: Mon, 17 Jan 2022 12:17:42 -0500 Subject: [PATCH] Set native stack size using -Xmso instead of -Xss OpenJ9 uses -Xmso to set native stack size, so launcher should also use this value when creating the JVM thread. Signed-off-by: Mike Zhang --- src/java.base/share/native/libjli/java.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/java.base/share/native/libjli/java.c b/src/java.base/share/native/libjli/java.c index a38ddae63d1..8f97927bdb4 100644 --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c @@ -23,6 +23,12 @@ * questions. */ +/* + * =========================================================================== + * (c) Copyright IBM Corp. 2022, 2022 All Rights Reserved + * =========================================================================== + */ + /* * Shared source for 'java' command line tool. * @@ -934,9 +940,12 @@ AddOption(char *str, void *info) options[numOptions].optionString = str; options[numOptions++].extraInfo = info; - if (JLI_StrCCmp(str, "-Xss") == 0) { + /* In OpenJ9 -Xmso is used to set native stack size instead of -Xss. -Xss is used to + * set Java thread size only, which is handled in the JVM code. + */ + if (JLI_StrCCmp(str, "-Xmso") == 0) { jlong tmp; - if (parse_size(str + 4, &tmp)) { + if (parse_size(str + 5, &tmp)) { threadStackSize = tmp; /* * Make sure the thread stack size is big enough that we won't get a stack