• Feldman Caspersen posted an update 1 year, 6 months ago

    – 2 commits

    Native Minecraft Servers with GraalVM Native Image

    The Minecraft server is known to consume a lot of memory and CPU and can be hard to deploy. This project allows you to convert the Minecraft server into a self-contained native executable using GraalVM Native Image. As such, it is designed to use fewer resources in terms of memory and CPU and provide faster startup times, and be less expensive and easier to deploy.

    A native Minecraft server is less than 120MB in size, and with that significantly smaller than Minecraft’s server.jar plus a JDK required to run it. The native executable is able to be compressed to shrink its size to less than 40MB. This is smaller than the server.jar. Initial experiments also suggest competitive run-time performance with smaller footprint in memory. Create using GraalVM Enterprise native image to get best results. This will give you greater performance and less memory consumption than the Community Edition. Also, test the G1 GC or Profile-Guided Optimizations. The Oracle Cloud Free Tier not only offers four Ampere A1 cores and 24GB of RAM always free that’s enough for hosting a Minecraft server, but also free access to GraalVM Enterprise.

    For more details, read this blog post.

    Disclaimer: This project is meant to be used for demonstration purposes only. It is intended to help the Minecraft community evaluate the use of GraalVM Native Image. Please use at your own risk. Some forums

    1. Download GraalVM Community or Enterprise (GraalVM 22.2.0 or later is required). Optional: Ensure that upx is installed on your $PATH in order to enable compression. 2. Download or visit this repository and run build.sh. 3. Launch the native Minecraft server with ./native-minecraft-server. You must agree to Minecraft’s EULA the first time you start the server.

    How it works

    This project contains only the build.sh script along with reachability metadata and instructions to build a native Minecraft server. The build.sh script downloads Minecraft’s server.jar and then extracts jars and other resources from it. Afterward, it invokes GraalVM Native Image with an appropriate configuration to generate a native version of the Minecraft server. Finally, if upx is found on $PATH the script will compress native executable.

    Limitations and known issues

    The configuration currently supports Minecraft 1.18.2. – The server GUI is not fully supported as of at this time. Mods aren’t currently supported. There is currently no build script for Windows, but the WSL should work. – The native executable sometimes fails on startup. It is generally possible to restart it several times. Error: com.mojang.datafixers.types.templates.List$ListType cannot be cast to java.lang.Comparable.

dealz123.com
Logo
Register New Account
Reset Password
Shopping cart