How to increase memory on minecraft marketplace server.

I just deployed "Minecraft Game Server – Java Edition" from the Linode Marketplace. With more players "Linode 2GB" was causing lag and stutter, so I resized my linode "Linode 4GB". However, the Minecraft debug panel (pressing F3 in-game) still shows only 2GB allocated to my server. How do I go about increasing the amount of ram available to minecraft server.

I am new to all this, so any help would be appreciated.

3 Replies

According to this article titled How to Allocate More RAM to a Minecraft Server,

"RAM allocation is handled by command-line arguments passed along to the server software during startup."

They share an example command used to set the memory allocation as well. Since you've upgraded to a 4GB Linode, that command would look like this:

java -Xmx1024M -Xms4096M -jar server.jar nogui

Additionally, this post from the Community Questions site titled Allocate More RAM to Minecraft Server discusses this same issue. There, some users discuss setting this as an environment variable or as a bash script.

java -Xmx4096M -Xms1024M -jar server.jar nogui

The max and min amount were backwards.

I've ran the command but get an error.

Starting net.minecraft.server.Main
[01:30:22] [ServerMain/INFO]: Building unoptimized datafixer
[01:30:24] [ServerMain/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[01:30:24] [ServerMain/ERROR]: Failed to start the minecraft server
alo$a: /home/server/serverfiles/./TH(o)G/session.lock: already locked (possibly by other Minecraft instance?)
at alo$a.a(SourceFile:98) ~[server-1.19.2.jar:?]
at alo.a(SourceFile:44) ~[server-1.19.2.jar:?]
at drq$c.<init>(SourceFile:333) ~[server-1.19.2.jar:?]
at drq.c(SourceFile:321) ~[server-1.19.2.jar:?]
at net.minecraft.server.Main.main(SourceFile:125) ~[server-1.19.2.jar:?]
at net.minecraft.bundler.Main.lambda$run$0(Main.java:54) ~[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]</init>

The only way I know to stop Minecraft is to power it off or restart the linode instance

Here's the source of your error:

/home/server/serverfiles/./TH(o)G/session.lock: already locked (possibly by other Minecraft instance?)

Try removing this file.

The only way I know to stop Minecraft is to power it off or restart the linode instance

This may help:

https://blog.minecraft.buzz/how-to-shut-down-minecraft-server/

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct