Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit fcca400

Browse files
committed
Cleaned up jvm flags
1 parent 9ad9a6b commit fcca400

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

MineColab.ipynb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"colab_type": "text"
2222
},
2323
"source": [
24-
"<a href=\"https://colab.research.google.com/github/thecoder-001/MineColab/blob/master/MineColab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
24+
"<a href=\"https://colab.research.google.com/github/thecoder-001/MineColab/blob/jvm-args-cleanup/MineColab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
2525
]
2626
},
2727
{
@@ -87,6 +87,13 @@
8787
"jar_list = {'paper': 'server.jar', 'fabric': 'fabric-server-launch.jar', 'generic': 'server.jar'}\n",
8888
"jar_name = jar_list[colabconfig[\"server_type\"]]\n",
8989
"\n",
90+
"# Java arguments.\n",
91+
"if colabconfig[\"server_type\"] == \"paper\":\n",
92+
" server_flags = \"-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true\"\n",
93+
"else:\n",
94+
" server_flags = \"\" # aiker's flags might negatively impact performance on non-paper servers.\n",
95+
"memory_allocation = \"-Xmx6144M -Xms6144M\"\n",
96+
"\n",
9097
"# Chose the tunnle service you want to use\n",
9198
"# Available options: ngrok, argo\n",
9299
"tunnel_service = \"argo\"\n",
@@ -110,14 +117,14 @@
110117
" print('Your server address is ' + ((str(url).split('\"')[1::2])[0]).replace('tcp://', ''))\n",
111118
"\n",
112119
" print('Starting server...')\n",
113-
" !java -Xmx6144M -Xms6144M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar $jar_name nogui\n",
120+
" !java $memory_allocation $server_flags -jar $jar_name nogui\n",
114121
"\n",
115122
"else:\n",
116123
" # Download & make argo executable\n",
117124
" !wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64\n",
118125
" !chmod +x cloudflared-linux-amd64\n",
119126
" print('Starting server...')\n",
120-
" !./cloudflared-linux-amd64 tunnel --url tcp://127.0.0.1:25565 | java -Xmx6144M -Xms6144M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar $jar_name nogui\n"
127+
" !./cloudflared-linux-amd64 tunnel --url tcp://127.0.0.1:25565 | java $memory_allocation $server_flags -jar $jar_name nogui\n"
121128
],
122129
"execution_count": null,
123130
"outputs": []
@@ -314,4 +321,4 @@
314321
"outputs": []
315322
}
316323
]
317-
}
324+
}

0 commit comments

Comments
 (0)