Server TPS dropping to <10 in ~1 min after starting up, then crashes (java.lang.OutOfMemoryError: Metaspace)

  • I am an admin on a server and the server TPS keeps dropping to below 10 in about one minute after the server starts up. Right when the server starts up, the TPS is already around 15. It drops around 1 TPS every 5 seconds. A few minutes later, the server is unplayable even with one player and the player(s) will automatically be disconnect due to the server TPS. Then, the server crashes.

    Here is the log:

    (This also generated eight extra errors for other plugins that I need for the server.)

    In the log, it states that the memory has ran out. "java.lang.OutOfMemoryError: Metaspace". Most of that is under the line where I executed the command "/ifo" (line 629-630). I don't really understand what the issue is when executing "/ifo".

    [14:09:31] [Server thread/ERROR]: [Essentials] Command ifo failed:
    632java.lang.OutOfMemoryError: Metaspace
    633at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
    634at java.lang.ClassLoader.defineClass( ~[?:?]
    635at ~[?:?]
    636at ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    637at java.lang.ClassLoader.loadClass( ~[?:?]
    638at ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    639at ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    640at java.lang.ClassLoader.loadClass( ~[?:?]
    641at com.earth2me.essentials.textreader.KeywordReplacer.replaceLine( ~[EssentialsX-2.19.2.jar:?]
    642at com.earth2me.essentials.textreader.KeywordReplacer.replaceKeywords( ~[EssentialsX-2.19.2.jar:?]
    643at com.earth2me.essentials.textreader.KeywordReplacer.<init>( ~[EssentialsX-2.19.2.jar:?]
    644at ~[EssentialsX-2.19.2.jar:?]
    645at ~[EssentialsX-2.19.2.jar:?]
    646at ~[EssentialsX-2.19.2.jar:?]
    647at com.earth2me.essentials.Essentials.onCommandEssentials( ~[EssentialsX-2.19.2.jar:?]
    648at com.earth2me.essentials.Essentials.onCommand( ~[EssentialsX-2.19.2.jar:?]
    649at org.bukkit.command.PluginCommand.execute( ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    650at org.bukkit.command.SimpleCommandMap.dispatch( ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
    651at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand( ~[paper-1.18.1.jar:git-Paper-177]
    652at ~[?:?]
    653at ~[?:?]
    654at ~[?:?]
    655at ~[?:?]
    656at ~[?:?]
    657at$ensureRunningOnSameThread$1( ~[?:?]
    658at$$Lambda$9328/ Source) ~[?:?]
    659at ~[paper-1.18.1.jar:git-Paper-177]
    660at net.minecraft.util.thread.BlockableEventLoop.doRunTask( ~[?:?]
    661at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask( ~[?:?]
    662at net.minecraft.server.MinecraftServer.doRunTask( ~[paper-1.18.1.jar:git-Paper-177]
    663at net.minecraft.server.MinecraftServer.c( ~[paper-1.18.1.jar:git-Paper-177]
    664at net.minecraft.util.thread.BlockableEventLoop.pollTask( ~[?:?]

    Also, at line 624 & 626, it states:

    624 [14:08:16] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 96593ms or 1931 ticks behind

    626 [14:09:16] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 29685ms or 593 ticks behind

    What is happening?

    Please let me know if there are any solutions.

  • ZXVoidx

    Changed the title of the thread from “Server TPS dropping to <10 in ~1 min after starting up server” to “Server TPS dropping to <10 in ~1 min after starting up, then crashes (java.lang.OutOfMemoryError: Metaspace)”.