[SPIGOT-6763] spigot 1.17 takes much more memory use than spigot 1.16 Created: 18/Oct/21  Updated: 18/Oct/21  Resolved: 18/Oct/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: 1055Lab Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.17.1, spigot
Environment:

Operating System: Windows 10 professional(16G RAM) and Windows server 2019(128G RAM)

JDK: OpenJDK16.0.2(IBM semeru, openj9), OracleJDK16.0.2(hotspot) and zuluOpenJDK17(hotspot)

Minecraft Server: Spigot 1.17.1 and 1.16.5(build with OracleJDK16 today and are the latest version), Paper 1.17.1.


Attachments: PNG File image-2021-10-18-12-07-18-078.png     PNG File image-2021-10-18-12-10-30-833.png     PNG File image-2021-10-18-12-13-18-275.png     PNG File image-2021-10-18-12-20-37-776.png     PNG File image-2021-10-18-12-28-14-560.png    
Version: This server is running CraftBukkit version 3262-Spigot-dc75aca-f0f801e (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT)
Plugin: no plugins
Guidelines Read: Yes

 Description   

as described in title, I find that spigot 1.17 takes much more memory usage than 1.16 on OracleJDK16 and zuluOpenJDK17 both of which are based on hotspot JVM. But for OpenJDK16 with openj9 JVM, the memory usage is much less and very close to the 1.16 memory usage.

I build the spigot via OracleJDK16 for spigot 1.17.1 and 1.16.5 and start the server with no plugins.Here is my start script. Each time i will start the server and wait for 1 minutes after the CPU usage drop close to zero.

 

@echo off
title testServer
set JAVA_HOME=C:\Program Files\Java\jdk-16.0.2
set CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
set PATH=%JAVA_HOME%\bin;
java -Xms1G -Xmx12G -jar spigot.jar nogui

 

the third to fifth lines are used to set java path, I change it to test different JDK. The JVM parameters are the same for the following tests.

 

The result is as following:

OracleJDK16, spigot 1.17.1

OracleJDK16, spigot 1.16.5

OpenJDK16, spigot 1.17.1

The first three tests were made in my computer with windows 10 professional and 16G RAM.And if when testing in my windows server with 128G RAM, it takes more RAM usage(with OracleJDK16)

And the zulu OpenJDK16 also consumes much more RAM usage in 1.17.

I have tested paper too, it behaves normal both for hotspot and j9vm and takes much less memory space.

 

Though when updating to a higher version of minecraft server usually means more CPU and RAM usage, but I think the doubled memory usage is abnormal. You might want to tell me that I should make xms=xmx. But anyway, a lower memory usage is much more better, is not it?

 



 Comments   
Comment by md_5 [ 18/Oct/21 ]

Increased memory usage is only relevant if it causes Xmx to be exceeded and have an OutOfMemory error. Otherwise what you are seeing is Java operating in the most efficient way you have allowed it to. Decrease Xmx if this usage is an issue.

Additionally this is likely not related to Spigot, but either your JDK or Minecraft itself.

Generated at Tue Apr 15 09:25:39 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.