SteamWar/BungeeCore
Archiviert
13
2

Use OpenJ9 #260

Zusammengeführt
Lixfel hat 2 Commits von openj9 nach master 2021-10-12 11:45:13 +02:00 zusammengeführt
Nur Änderungen aus Commit 801d9da2e1 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -32,8 +32,7 @@ import java.util.logging.Level;
public abstract class Node {
private static final List<String> JVM_ARGS = Arrays.asList("-Dlog4j.configurationFile=log4j2.xml", "-server", "-Xms128M", "-XX:+UseCompressedOops", "-XX:+TieredCompilation", "-XX:TargetSurvivorRatio=90", "-XX:SurvivorRatio=8", "-XX:MaxTenuringThreshold=15", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseBiasedLocking", "-XX:UseSSE=3", "-XX:+UseCodeCacheFlushing", "-XX:+UseThreadPriorities", "-XX:+AggressiveOpts", "-XX:+ReduceSignalUsage", "-XX:+UseInterpreter", "-XX:+UseSharedSpaces", "-XX:AllocatePrefetchStyle=1", "-XX:+AlwaysCompileLoopMethods", "-XX:+UseConcMarkSweepGC", "-XX:+RewriteFrequentPairs", "-XX:+OptimizeStringConcat", "-XX:+CMSCleanOnEnter", "-XX:+UseInlineCaches");
private static final List<String> JVM8_ARGS = Arrays.asList("-XX:ThreadPriorityPolicy=42", "-XX:SharedReadOnlySize=30m", "-XX:+UseFastEmptyMethods", "-XX:+UseFastAccessorMethods");
private static final List<String> OPENJ9_ARGS = Arrays.asList("-Xsyslog:none", "-Xtrace:none", "-Xdisableexplicitgc", "-XX:+AlwaysPreTouch", "-XX:+CompactStrings");
private static final double MIN_FREE_MEM = 4.0 * 1024 * 1024; // 4 GiB
private static final List<Node> nodes = new ArrayList<>();
@ -74,21 +73,15 @@ public abstract class Node {
public abstract String getName();
public abstract double getLoad();
protected void constructServerstart(List<String> cmd, String serverJar, String worldDir, String levelName, int port, String xmx, String... dParams) {
boolean jdk11 = serverJar.contains("1.15.2");
if(jdk11)
cmd.add("/usr/lib/jvm/java-11-openjdk-amd64/bin/java");
else
cmd.add("java");
protected void constructServerstart(File directory, List<String> cmd, String serverJar, String worldDir, String levelName, int port, String xmx, String... dParams) {
cmd.add("/usr/lib/jvm/java-16-openj9-amd64/bin/java");
for(String param : dParams){
cmd.add("-D" + param);
}
cmd.add("-Xmx" + xmx);
cmd.addAll(JVM_ARGS);
if(!jdk11)
cmd.addAll(JVM8_ARGS);
cmd.add("-Xshareclasses:nonfatal,name=" + directory.getName());
cmd.addAll(OPENJ9_ARGS);
cmd.add("-jar");
cmd.add("/binarys/" + serverJar);
cmd.add("--log-strip-color");
@ -126,7 +119,7 @@ public abstract class Node {
@Override
public ProcessBuilder startServer(String serverJar, File directory, String worldDir, String levelName, int port, String xmx, String... dParams) {
List<String> cmd = new ArrayList<>();
constructServerstart(cmd, serverJar, worldDir, levelName, port, xmx, dParams);
constructServerstart(directory, cmd, serverJar, worldDir, levelName, port, xmx, dParams);
ProcessBuilder builder = new ProcessBuilder(cmd);
builder.directory(directory);
return builder;
@ -172,7 +165,7 @@ public abstract class Node {
public RemoteNode(String remote) {
this.remote = remote;
//Determin core count
//Determine core count
Process process;
try {
process = new ProcessBuilder("ssh", remote, "nproc").start();
@ -213,7 +206,7 @@ public abstract class Node {
cmd.add("cd");
cmd.add(directory.getPath());
cmd.add(";");
constructServerstart(cmd, serverJar, worldDir, levelName, port, xmx, dParams);
constructServerstart(directory, cmd, serverJar, worldDir, levelName, port, xmx, dParams);
return new ProcessBuilder(cmd);
}