diff --git a/rxr_mc/.env b/rxr_mc/.env index 3a183c9..60729d4 100644 --- a/rxr_mc/.env +++ b/rxr_mc/.env @@ -1,4 +1,4 @@ MC_DIR=/root/mc/renyuan/Server # 活动目录(主机上的路径) JAR_FILE=./Purpur-1.20.1.jar # jar 文件的路径 -MAX_MEMORY=7G -MIN_MEMORY=7G \ No newline at end of file +MAX_MEMORY=5G +MIN_MEMORY=5G \ No newline at end of file diff --git a/rxr_mc/docker-compose.yaml b/rxr_mc/docker-compose.yaml index 8b093ea..79dccee 100644 --- a/rxr_mc/docker-compose.yaml +++ b/rxr_mc/docker-compose.yaml @@ -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