diff options
Diffstat (limited to 'lib/compilers/java.ts')
-rw-r--r-- | lib/compilers/java.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compilers/java.ts b/lib/compilers/java.ts index 894f04a0f..fc7691b8a 100644 --- a/lib/compilers/java.ts +++ b/lib/compilers/java.ts @@ -25,6 +25,7 @@ import path from 'path'; import fs from 'fs-extra'; +import Semver from 'semver'; import type {ParsedAsmResult, ParsedAsmResultLine} from '../../types/asmresult/asmresult.interfaces.js'; import {BypassCache} from '../../types/compilation/compilation.interfaces.js'; @@ -132,12 +133,16 @@ export class JavaCompiler extends BaseCompiler implements SimpleOutputFilenameCo override async handleInterpreting(key, executeParameters: ExecutableExecutionOptions) { const compileResult = await this.getOrBuildExecutable(key, BypassCache.None); if (compileResult.code === 0) { + const extraXXFlags: string[] = []; + if (Semver.gte(utils.asSafeVer(this.compiler.semver), '11.0.0', true)) { + extraXXFlags.push('-XX:-UseDynamicNumberOfCompilerThreads'); + } executeParameters.args = [ '-Xss136K', // Reduce thread stack size '-XX:CICompilerCount=2', // Reduce JIT compilation threads. 2 is minimum - '-XX:-UseDynamicNumberOfCompilerThreads', '-XX:-UseDynamicNumberOfGCThreads', '-XX:+UseSerialGC', // Disable parallell/concurrent garbage collector + ...extraXXFlags, await this.getMainClassName(compileResult.dirPath), '-cp', compileResult.dirPath, |