Help needed with a possible memory leak on my server.

I’m dealing with a memory leak issue on my server that I just can’t seem to fix. The memory usage keeps climbing steadily and never goes back down, eventually causing the server to crash. I’ve checked a few things, but nothing seems to help. Here’s my server setup: RAM: 6GB CPU: Ryzen 7 7700 Mods: c2me carpet-extra carpet-tis-addition catbans Chunky Discord-MC-Chat fabric-api fabric-carpet fabric-language-kotlin ferritecore journeymap ledger lithium LuckPerms modernfix NoChatReports plasmovoice servercore servux spark syncmatica I’ve been keeping an eye on the memory usage, and it just keeps increasing and never drops back down, which eventually causes the server to crash. I’m at a loss for how to fix this. Does anyone have any suggestions, or have you dealt with a similar issue before? Any help would be greatly appreciated!
45 Replies
Schroedes
Schroedes2d ago
a spark report would probably assist !spark
Carl-bot
Carl-bot2d ago
Spark Profiler
Spark can be used to see why your server or client is lagging. Users can share a spark report via /spark profiler start --timeout 300 which creates a report after 5 minutes. The spark report is useful in debugging why your server is lagging, so ideally you should always provide one while asking for support. Download | Website | Docs
From An unknown user
Admincraft Canned Responses
Sylver!!
Sylver!!OP2d ago
For some reason this command doesn’t work properly
Carl-bot
Carl-bot2d ago
Please check your server log for errors from your plugins.
If you need further help understanding the errors, please send us the whole log file. Where can I find the server log? Logs are stored in <server_directory>/logs/. Search for a file explorer in your server's management interface and navigate to that directory. Once you've opened that up, search for the latest.log file. Some providers have a separate page for logs and may hide the "logs" folder. On Aternos: • Go to https://aternos.org/log/. On Minehut and server.pro: • Go to the "files" tab in the left menu. • Navigate to the root directory of your server. • From there navigate to /logs/latest.log. What should I do with the log? • First of all, read it! I mean, that's what you do all the time when you run a server, isn't it? Try to locate any errors that have anything to do with the issue you are facing. • If you got the latest.log file or created a .txt file with the necessary errors you can upload these directly to the channel, but we prefer if you upload them to https://mclo.gs/. • If you have trouble downloading the log file, copy/paste the text to a paste service (like mclogs). Copy the link that it gives you and send it to us. (Don't worry, McLogs hides your users' IPs.)
Admincraft Canned Responses
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
What's the output of running spark that doesn't work?
Sylver!!
Sylver!!OP2d ago
[18:47:17] [spark-worker-pool-1-thread-2/INFO]: [⚡] Expected flag at position 1 but got '—timeout' instead! spark profiler —timeout 300 [18:47:33] [spark-worker-pool-1-thread-3/INFO]: [⚡] Expected flag at position 1 but got '300' instead! spark profiler start —timeout 300 tried the exact same command and it just worked weird, but ill update u in 5 minutes with the spark link
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
spark profiler start --alloc Send the logs in something like mclogs, I'm not sure if that '—timeout' instead! is discord or minecraft combining the '--' into '—'
Sylver!!
Sylver!!OP2d ago
you want me to grab the latest.log and put it into mclogs?
Sylver!!
Sylver!!OP2d ago
heres the spark link too https://spark.lucko.me/Avt5sqipnL
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
You're combining '--' into '—'' somehow
No description
Sylver!!
Sylver!!OP2d ago
no clue i was typing it on my phone so maybe its just an iOS thing
Sylver!!
Sylver!!OP2d ago
but when i typed it through the panel on my pc it worked
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Copy the --timeout flag instead of typing it
Sylver!!
Sylver!!OP2d ago
yea will do next time if i need to use my phone So do you have any possible idea as to why the memory just increases and never decreases?
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Everything seems fine here, I'd just add aikar's flags Run spark profiler start --alloc when you notice the memory leak, then run spark profiler stop after a couple of mins (3-5)
Sylver!!
Sylver!!OP2d ago
Okay will do Also do you have any idea why when I contacted support for this on the official hosters discord they told me my server had no mods and was running vanilla minecraft? Is that a me problem or a them problem? Because even spark shows its on fabric
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
You can also run spark heapdump to get a snapshot of the heap and analyze it with something like intellij or eclipse memory analyzer
Sylver!!
Sylver!!OP2d ago
https://spark.lucko.me/EfFOQiQtNP heres the --alloc link
spark
spark is a performance profiler for Minecraft clients, servers, and proxies.
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
no idea, its clearly running fabric with a lot of mods
Sylver!!
Sylver!!OP2d ago
yeah idk what theyre on about then it doesnt have a lot of mods, theres probably about 9 or 10
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Yh, i don't have a good definition of what's a lot, I usually keep plugins at minimum possible, and I don't run modded servers
Sylver!!
Sylver!!OP2d ago
Yeah only reason we use mods is because we use fabric, because we want as close to vanilla as possible
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Looks like normal stuff from carpet and c2me Doesn't look like a memory leak
Sylver!!
Sylver!!OP2d ago
It's just like, the ram doesnt come back down It plateaus for a while then it just goes up, and then plateaus again
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Try running it when the ram is higher and take a heapdump
Sylver!!
Sylver!!OP2d ago
Will do
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
You'll have to analyze that yourself tho, heapdumps take a couple of gb
Sylver!!
Sylver!!OP2d ago
Do you have any advice for possibly increasing server performance? yeah this heapdump was 1gb
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Aikar's flags | PaperMC Docs
Aikar's flags are a set of JVM flags designed to improve the performance of your Paper server.
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
Seem to work well on fabric as well Tho your ptero ram indicator will become unreliable
Sylver!!
Sylver!!OP2d ago
My panel doesn't allow me to change the startup command
𝐁𝐢𝐪𝐮𝐚𝐭𝐞𝐫𝐧𝐢𝐨𝐧𝐬
No idea, fabric is out of my scope, but I don't think it has optimization alternatives besides installing lithium
Sylver!!
Sylver!!OP2d ago
ill make my mods folder more minimal might reload most if not all of them Seems to be a little better now, If the support for humbleservers ever reply ill ask them to change the startup command for me
Snow Kit
Snow Kit2d ago
how are you checking the memory usage for your server? With spark, or just checking what the panel shows?
Sylver!!
Sylver!!OP2d ago
both with spark and panel sorry for quick reply
Snow Kit
Snow Kit2d ago
well, the memory usage you see in spark shouldn't only increase it should jump up and down
Sylver!!
Sylver!!OP2d ago
it just jumps up and up and up
Snow Kit
Snow Kit2d ago
well, every ~30 seconds it should go down, according to the spark reports
Sylver!!
Sylver!!OP2d ago
ive decided to switch hosters now tho, so hopefully all should be smooth sailing nop, just up and up
Snow Kit
Snow Kit2d ago
anyways, it's normal for java to just not release memory the launch arguments say it can use up to 3gb of memory, so it'll use up to 3gb of memory and run garbage collection only when it needs to unless you have GC running excessively frequently (every 5s or more frequently) or your server crashes with an OutOfMemoryException, you probably don't have a memory leak.

Did you find this page helpful?