Skip to content

Commit

Permalink
feat(jvm): update jvm for jdk17
Browse files Browse the repository at this point in the history
  • Loading branch information
halibobo1205 committed Jul 24, 2024
1 parent fda215f commit ca98680
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 8 additions & 6 deletions gradle/java-tron.vmoptions
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-XX:+UseConcMarkSweepGC
-XX:+PrintGCDetails
-Xloggc:./gc.log
-XX:+PrintGCDateStamps
-XX:+CMSParallelRemarkEnabled
-Xmx9G
-XX:+UseZGC
-Xlog:gc*:file=gc-%t.log:time,uptime,level,tags:filecount=50,filesize=100M
-XX:ReservedCodeCacheSize=256m
-XX:+CMSScavengeBeforeRemark
-XX:+UseCodeCacheFlushing
-XX:MetaspaceSize=256m
-XX:MaxMetaspaceSize=512m
-XX:MaxDirectMemorySize=1g
-XX:+HeapDumpOnOutOfMemoryError
13 changes: 7 additions & 6 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,13 @@ startService() {
exit
fi

nohup $JAVACMD -Xms$JVM_MS -Xmx$JVM_MX -XX:+UseConcMarkSweepGC -XX:+PrintGCDetails -Xloggc:./gc.log \
-XX:+PrintGCDateStamps -XX:+CMSParallelRemarkEnabled -XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing \
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
-XX:MaxDirectMemorySize=$MAX_DIRECT_MEMORY -XX:+HeapDumpOnOutOfMemoryError \
-XX:NewRatio=2 -jar \
$JAR_NAME $FULL_START_OPT >>start.log 2>&1 &
nohup $JAVACMD -Xms$JVM_MS -Xmx$JVM_MX \
-XX:+UseZGC \
-Xlog:gc*:file=gc-%t.log:time,uptime,level,tags:filecount=50,filesize=100M \
-XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing \
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
-XX:MaxDirectMemorySize=$MAX_DIRECT_MEMORY -XX:+HeapDumpOnOutOfMemoryError \
-jar $JAR_NAME $FULL_START_OPT >>start.log 2>&1 &
checkPid
echo "info: start java-tron with pid $pid on $HOSTNAME"
echo "info: if you need to stop the service, execute: sh start.sh --stop"
Expand Down

0 comments on commit ca98680

Please sign in to comment.