Hi! I don't know where else to report this, didn't find anything useful on the internet, so i decided as a last try to write here.
My issue is that when my server's GC frees up the ram, or even just while running, it gets insanely laggy sometimes. Sending the warnings "Can't keep up! Is the server overloaded? Running 6980ms or 139 ticks behind" like this. I gave the server 16GB ram, but as i noticed its not using my cpu fully, only a few cores.
Here are the specs:
CPU: AMD Ryzen 7 5800X3D
Motherboard: MSI B550-A-PRO
RAM: 2x16GB Corsair Vengeance 3600MHz CL16
GPU: AMD Radeon RX6600XT
SSD: Apacer AS2280Q4 1TB
I really hope this is the right place to post this, and hoping to find a solution.
The lags on the normal server were much worse than on papermc, happened every minute, rather than 2-3 minutes on paper)
Performance logs of the original server file attached, every other information is the same
Linked issues
is duplicated by 1
relates to 2
Attachments
Comments 21
also I noticed the JVM flag -XX:ActiveProcessorCount=8 is causing worse performance on server and host computer.
Thanks for the reply, I'll try these as soon as possible. I use the jvm flag "-XX:ActiveProcessorCount=8" because as i noticed these lags were a bit less frequent
I also found out this only happens on Windows. When I ran the server and the client both on Arch Linux I haven't noticed these lags. Plus i tried that i ran the client on my pc, and the server on a lower end laptop (8gb ddr3 ram, gave 7gb to the server, the cpu is i5-4200U), and i haven't noticed these lags there neither.
Simple explanation: -XX:ActiveProcessorCount=8 this java argument apparently decreases minor GC's and results in more major GC runs.ย So even though it is a valid java argument treat it as experimental.
No it didnโt help, i was already running it with a different java (not the minecraft default java)
I've set this bug report to "plausible" so that Mojang can investigate, as this could be a bad memory leak somewhere.
Important information from the comments not mentioned in the bug report itself:
Happens regardless of world, although for less busy worlds the memory grows slower
Does not happen if server runs on Linux (appears to be a Windows-only issue)
Happens regardless of used Java runtime
Less allocated RAM makes the issue worse
@@unknown, regarding your comment "Only thing that helped was running the server on linux", I'm assuming you were running it on the same hardware but with different OS? If not, what hardware did you use to run it on Linux?
Also if there's any information that you think could be useful for investigating this, please provide it.
Yes, this is a memory leak in jdk 21 G1GC, also present in MC-273262 , MC-271216, MC-273024, and many more. Two easy solutions, one more challenging 1. Implement along the lines of using java args such as (ParallelGC by default with 6 threads, a minimal GCTimeRatio such as 0, and minimal GCPauseMillis=1) 2. Remove G1GC from valid java arguments.ย 3. Other solutions such as fixing Minecraft's caches could work.
So this is mainly an issue with (minecraft's caches) and an (issue with mobs), best option atm is using modrinth "aesthetic and performant" pageย
ย