This commit is contained in:
Zengtudor 2024-12-29 13:07:56 +08:00
parent 5b2c70eb54
commit 74217cdffe
2 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
MC_DIR=/root/mc/renyuan/Server # 活动目录(主机上的路径)
JAR_FILE=./Purpur-1.20.1.jar # jar 文件的路径
MAX_MEMORY=7G
MIN_MEMORY=7G
MAX_MEMORY=5G
MIN_MEMORY=5G

View File

@ -4,13 +4,13 @@ services:
container_name: minecraft-server
working_dir: /mc-server
environment:
- MAX_MEMORY=7G # 设置最大内存为 10GB
- MIN_MEMORY=7G # 将最小内存也设置为 10GB确保不会低于该值
- MAX_MEMORY=5G # 设置最大内存为 10GB
- MIN_MEMORY=5G # 将最小内存也设置为 10GB确保不会低于该值
- TZ=Asia/Shanghai
volumes:
- ${MC_DIR}:/mc-server
command: >
java -Xms${MIN_MEMORY} -Xmx${MAX_MEMORY} -XX:MaxRAM=8G
java -Xms${MIN_MEMORY} -Xmx${MAX_MEMORY} -XX:MaxRAM=5G
-XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m
-XX:MaxDirectMemorySize=2G
-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200