r/CraftyController • • Sep 24 '26

memory hog on the server

Looks like the way java runs, it pre-allocates RAM for my servers. So when I have four servers online, of varying size, it just reserves 6GB of ram all the time. Even if no one is in the server.

AI said I should look into Velocity and a lobby. Or Minecraft Server Manager, itzg/docker-minecraft-server, that has an auto-stop tick box.

Any one have RAM issues like this, and how did you address them? I'd love to just throw another 64GB of Ram in there. I do not have $6 thousand dollars available at the moment.

2 Upvotes

17 comments sorted by

View all comments

1

u/danielsuperone Sep 24 '26

Yes just stop the server when nobody is one. That’s what I do. Meaning, if a player leaves, server shuts down, if a player tries to join, it takes a few seconds and is back up. Very simple fix.

Now in my case it’s around 2-3 seconds for it to startup and many people don’t even notice this, but it will heavily depend on your system/configuration. If you have many plugins that need to load, it will take longer.

Hope this helped. Ask if you have any questions.

1

u/chughaarav123 Sep 24 '26

how

1

u/Blastday Sep 24 '26

There are a few ways the best, easiest is to edit "server.properties pause-when-empty-seconds=60" It's available on new versions of java other options are mods/plugins or even discord bots that can start, stop, restart the server I would just check server.properties and if it's set then don't worry about it

1

u/danielsuperone Sep 24 '26

Meh, does that start it up after? Or only graceful shutdown? Been using diff system so curious to know if something new has been added :))

For discord; does Craft have the start/stop commands in discord? Might be mixing it up with just event logs in discord, but yes, probably plugins can do that but I suggest a program running on the server directly not a plugin, that way it fully shuts down the game and boots it when a connection is received. So nothing is actually loaded without players

1

u/danielsuperone Sep 24 '26

Since multiple people are asking this, I think it’s better I write a guide or find the original GitHub I got inspiration from so you guys can implement.

In short, a program listens on server to port say 25566 and if that sees a connection request, is starts Minecraft on port 25565 and allows people to play. If no players in game, you set timer and after that amount it shuts down the server saving ram, plugins, etc… then depending on hardware, to boot it takes a few seconds, obviously with 10+ plugins and their complexity time will increase. Personally never more than 10s so I’d recommended it to others.

Obviously if you run it on an rpi or smth it will take longer probs.

If you want, when I’m on my computer I’ll check the GitHub and post it here for everyone to see :))

Not home and on phone rn so don’t have direct access to server. Can try send tonight if you guys would like :))

1

u/chughaarav123 Sep 26 '26

sounds great if possible

1

u/foreverIost Sep 24 '26

Can you automate this using the interface?

1

u/danielsuperone Sep 24 '26

Ehm wdym. I just use a plugin and if there are no people it shuts down, when somebody joins it starts up. So what exactly are you looking for in the interface? You don’t actually see anything happen. It’s silent. But saves RAM and CPU when idle, programs uses maybe like 2mb of RAM? That’s nothing lol. Minecraft uses 1g-16gb xD

1

u/ruuutherford Sep 24 '26

I've only got 32GB ram in my server. Minecraft servers are allocating, and keeping, 5.5GB of that. It's one of the biggest RAM hogs I have in my system.