The maxMemory property of the options object passed to the launch function is overwritten if the options object does not also contain a valid extraJVMArgs property. This is because the generateArguments function appends the DEFAULT_EXTRA_JVM_ARGS constant to the array it returns if the aforementioned extraJVMArgs property is not present.
// add extra jvm args
if (options.extraJVMArgs instanceof Array) {
if (options.extraJVMArgs.some((v) => typeof v !== "string")) {
throw new TypeError("Require extraJVMArgs be all string!");
}
cmd.push(...options.extraJVMArgs);
} else {
cmd.push(...DEFAULT_EXTRA_JVM_ARGS);
}
This is only an issue because the DEFAULT_EXTRA_JVM_ARGS constant contains -Xmx2G in it.
The maxMemory property of the options object passed to the launch function is overwritten if the options object does not also contain a valid extraJVMArgs property. This is because the generateArguments function appends the DEFAULT_EXTRA_JVM_ARGS constant to the array it returns if the aforementioned extraJVMArgs property is not present.
(lines 664 - 672)
This is only an issue because the DEFAULT_EXTRA_JVM_ARGS constant contains
-Xmx2G
in it.(line 22)
Submitting an ez-mode pull request in a moment to check for this edge case and exclude the "-Xmx2G" flag if options.maxMemory is present.