What are the best JVM flags for a Minecraft Forge server?
My server's specs, very old I know:
Intel Core i5 4460
16 gigs of DDR3 RAM clocking at only 1600 MHz
1tb HDD (with 16 gigs of swap)
Now, I would like to optimize the server's performances and push it to the maximum without upgrading the hardware, that has a lot to be done.
I'm running a Forge 1.20.1 47.4.0 server with over 180+ mods (including a couple Fabric mods). One of the common issue is not MSPT or TPS (directly linked with the CPU) but rather RAM running out. Once RAM reaches its maximum allocated, the server becomes literally unplayable with rollbacks lasting like 100 seconds. This usually happens after people explore and generate chunks in different dimensions during the same session, like in the Twilight Forest and then the Ad Astra's moon dimension. I suspect that one of those mods just don't unload those dimensions from the memory, keeping the RAM perpetually clogged. One of the side effect of a full RAM is that it also slows down the system significantly, and that the garbage collector starts trying his best to clean any remaining bits from the RAM, thus costing a lot of CPU power.
I'm therefore looking for the best suited JVM flags for my server (i'm on JDK 21), cause I believe that I'm on default ones right now, but I do have some RAM optimisation mods like memorysweep, alltheleaks, memoryleakfix, ferritecore, etc.
Intel Core i5 4460
16 gigs of DDR3 RAM clocking at only 1600 MHz
1tb HDD (with 16 gigs of swap)
Now, I would like to optimize the server's performances and push it to the maximum without upgrading the hardware, that has a lot to be done.
I'm running a Forge 1.20.1 47.4.0 server with over 180+ mods (including a couple Fabric mods). One of the common issue is not MSPT or TPS (directly linked with the CPU) but rather RAM running out. Once RAM reaches its maximum allocated, the server becomes literally unplayable with rollbacks lasting like 100 seconds. This usually happens after people explore and generate chunks in different dimensions during the same session, like in the Twilight Forest and then the Ad Astra's moon dimension. I suspect that one of those mods just don't unload those dimensions from the memory, keeping the RAM perpetually clogged. One of the side effect of a full RAM is that it also slows down the system significantly, and that the garbage collector starts trying his best to clean any remaining bits from the RAM, thus costing a lot of CPU power.
I'm therefore looking for the best suited JVM flags for my server (i'm on JDK 21), cause I believe that I'm on default ones right now, but I do have some RAM optimisation mods like memorysweep, alltheleaks, memoryleakfix, ferritecore, etc.