Minecraft – Having a very odd lag issue on one Minecraft server

minecraft-java-editionminecraft-java-edition-serverperformance

On minecraft, I've been getting horrible lag on one of my favorite servers.

I checked the ping (by hovering over the bars in the multiplayer menu), and it's great: 35. However, when I join the server, I can't use any items, chat, or see other players move. I own another server hosted in the same place, which have no problems connecting. My friends can connect to the server, but I can't log on to it.

I attempted to log in to other servers and they work great, no problems. I run at 60mbps down and around 20mbps up.

Best Answer

If no-one else but you is experiencing this problem, it might be that your client has not enough memory assigned, and is doing forced garbage collecting every few seconds to make enough room to keep running the game. (N.B. "Garbage collecting" is the process in which unused memory is freed up. Normally it is done when nothing special is going on. Forced garbage collecting occurs when the java application runs out of memory and has to free up memory to keep running).

In the client, go to the start-up settings of the particular version you are running, and add the following JVM arguments:

-Xmx2560M -Xms2560M

Xmx2560M tells the Java virtual machine to allocate a maximum of 2560MB of memory to run the application, which is about 2.5GB. Xms2560M tells the JVM to allocate exactly 2560MB when the application starts. You can set the Xms option lower, but never higher than the Xmx option. It does not help to set the Xmx option higher than the amount of memory that is available after the OS and other processes take their share. If you would allocate more memory, it would need to be swapped from the hard drive, which is a very slow process.

Related Topic