Improve JVM startup time

This commit is contained in:
mathiascode 2020-08-02 16:39:00 +03:00
parent 7536988946
commit 043ef2989c
60 changed files with 1176 additions and 1984 deletions

View File

@ -1,10 +1,12 @@
#!/bin/sh
# The alive checker and Minecraft server is started at the same time. For performance reasons, the
# OpenJ9 JVM is used instead of Java's default Hotspot JVM.
# The alive checker and Minecraft server is started at the same time
PATH="$HOME/framework/vendor/java/bin/:$PATH"
# Dump classes
java -Xshare:dump
# Make sure we're in the server folder, located in the home directory
cd ~/server/
@ -32,21 +34,9 @@ while true; do
java \
-Xmx1800M \
-Xshare:on \
-Xss8M \
-Xtune:virtualized \
-Xaggressive \
-Xcompressedrefs \
-Xdump:heap+java+snap+system:none \
-Xdump:tool:events=throw+systhrow,filter=java/lang/OutOfMemoryError,exec="kill -9 %pid" \
-Xgc:concurrentScavenge \
-Xgc:dnssExpectedTimeRatioMaximum=3 \
-Xgc:scvNoAdaptiveTenure \
-Xdisableexplicitgc \
-Xshareclasses \
-Xshareclasses:noPersistentDiskSpaceCheck \
-XX:MaxDirectMemorySize=128M \
-XX:+ClassRelationshipVerifier \
-XX:+GlobalLockReservation \
-XX:+UseContainerSupport \
-DPaper.IgnoreJavaVersion=true \
-Dpaper.playerconnection.keepalive=360 \

View File

@ -1,25 +1,14 @@
#!/bin/sh
# This script is used as a reference to generate a stripped-down OpenJ9 JRE for the server
# This script is used as a reference to generate a stripped-down JRE for the server
rm -rf java/
wget https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12_openj9-0.21.0/OpenJDK14U-jdk_x64_linux_openj9_14.0.2_12_openj9-0.21.0.tar.gz
wget https://github.com/AdoptOpenJDK/openjdk14-binaries/releases/download/jdk-14.0.2%2B12/OpenJDK14U-jdk_x64_linux_hotspot_14.0.2_12.tar.gz
tar -zxvf OpenJDK*
rm OpenJDK*
mv jdk* jdk/
jdk/bin/jlink --no-header-files --no-man-pages --compress=2 --strip-debug \
--exclude-files=**java_*.properties,**jrunscript,**keytool,**legal/** \
--add-modules \
java.desktop, \
java.logging, \
java.management, \
java.naming, \
java.net.http, \
java.scripting, \
java.sql, \
jdk.crypto.ec, \
jdk.unsupported, \
jdk.zipfs, \
openj9.sharedclasses \
--add-modules java.desktop,java.logging,java.management,java.naming,java.net.http,java.scripting,java.sql,jdk.crypto.ec,jdk.unsupported,jdk.zipfs \
--output java
rm -rf jdk/

BIN
vendor/java/bin/java vendored

Binary file not shown.

Binary file not shown.

1167
vendor/java/lib/classlist vendored Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

BIN
vendor/java/lib/jexec vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +0,0 @@
"-Xlockword:mode=default,noLockword=java/lang/String,noLockword=java/util/MapEntry,noLockword=java/util/HashMap$Entry,noLockword=org/apache/harmony/luni/util/ModifiedMap$Entry,noLockword=java/util/Hashtable$Entry,noLockword=java/lang/invoke/MethodType,noLockword=java/lang/invoke/MethodHandle,noLockword=java/lang/invoke/CollectHandle,noLockword=java/lang/invoke/ConstructorHandle,noLockword=java/lang/invoke/ConvertHandle,noLockword=java/lang/invoke/ArgumentConversionHandle,noLockword=java/lang/invoke/AsTypeHandle,noLockword=java/lang/invoke/ExplicitCastHandle,noLockword=java/lang/invoke/FilterReturnHandle,noLockword=java/lang/invoke/DirectHandle,noLockword=java/lang/invoke/ReceiverBoundHandle,noLockword=java/lang/invoke/DynamicInvokerHandle,noLockword=java/lang/invoke/FieldHandle,noLockword=java/lang/invoke/FieldGetterHandle,noLockword=java/lang/invoke/FieldSetterHandle,noLockword=java/lang/invoke/StaticFieldGetterHandle,noLockword=java/lang/invoke/StaticFieldSetterHandle,noLockword=java/lang/invoke/IndirectHandle,noLockword=java/lang/invoke/InterfaceHandle,noLockword=java/lang/invoke/VirtualHandle,noLockword=java/lang/invoke/PrimitiveHandle,noLockword=java/lang/invoke/InvokeExactHandle,noLockword=java/lang/invoke/InvokeGenericHandle,noLockword=java/lang/invoke/VarargsCollectorHandle,noLockword=java/lang/invoke/ThunkTuple"

View File

@ -103,19 +103,6 @@ grant codeBase "jrt:/jdk.accessibility" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.awt";
};
grant codeBase "jrt:/jdk.attach" {
permission java.lang.RuntimePermission "accessClassInPackage.com.ibm.oti.util";
permission java.lang.RuntimePermission "accessClassInPackage.openj9.internal.tools.attach.target";
permission java.lang.RuntimePermission "accessClassInPackage.openj9.internal.tools.attach.diagnostics.base";
permission java.util.PropertyPermission "com.ibm.tools.attach.*", "read";
// required by com.ibm.tools.attach.attacher.OpenJ9AttachProvider.listVirtualMachinesImp():commonDir.exists(),
// openj9.internal.tools.attach.target.Reply.writeReply():new RandomAccessFile(replyFile, "rw"),
// and openj9.internal.tools.attach.target.Reply.deleteReply():replyFile.delete()
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
// required by com.ibm.tools.attach.attacher.OpenJ9VirtualMachine.tryAttachTarget():targetServer.accept()
permission java.net.SocketPermission "localhost:1024-", "accept,resolve";
};
grant codeBase "jrt:/jdk.charsets" {
permission java.util.PropertyPermission "os.name", "read";
permission java.lang.RuntimePermission "charsetProvider";
@ -219,26 +206,6 @@ grant codeBase "jrt:/jdk.zipfs" {
permission java.util.PropertyPermission "user.name", "read";
};
grant codeBase "jrt:/openj9.cuda" {
permission java.lang.RuntimePermission "accessClassInPackage.com.ibm.oti.vm";
permission java.lang.RuntimePermission "loadLibrary.cuda4j29";
permission java.lang.RuntimePermission "modifyThread";
permission java.lang.RuntimePermission "modifyThreadGroup";
permission java.util.PropertyPermission "com.ibm.oti.vm.library.version", "read";
};
grant codeBase "jrt:/openj9.gpu" {
permission com.ibm.gpu.GPUPermission "access";
permission java.lang.RuntimePermission "accessClassInPackage.com.ibm.gpu.spi";
permission java.lang.RuntimePermission "accessClassInPackage.com.ibm.oti.vm";
permission java.lang.RuntimePermission "modifyThread";
permission java.lang.RuntimePermission "modifyThreadGroup";
permission java.util.PropertyPermission "com.ibm.gpu.verbose", "read";
permission java.util.PropertyPermission "com.ibm.gpu.enforce", "read";
permission java.util.PropertyPermission "com.ibm.gpu.enable", "read";
permission java.util.PropertyPermission "com.ibm.gpu.disable", "read";
};
// permissions needed by applications using java.desktop module
grant {
permission java.lang.RuntimePermission "accessClassInPackage.com.sun.beans";

BIN
vendor/java/lib/server/classes.jsa vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

2
vendor/java/release vendored
View File

@ -1,2 +1,2 @@
JAVA_VERSION="14.0.2"
MODULES="java.base java.datatransfer java.xml java.prefs java.desktop java.logging java.management java.security.sasl java.naming java.net.http java.scripting java.transaction.xa java.sql jdk.crypto.ec jdk.unsupported jdk.zipfs openj9.sharedclasses"
MODULES="java.base java.datatransfer java.xml java.prefs java.desktop java.logging java.management java.security.sasl java.naming java.net.http java.scripting java.transaction.xa java.sql jdk.crypto.ec jdk.unsupported jdk.zipfs"