Zrips / CMI

116 stars 98 forks source link

server crashes #7074

Open justLxy opened 2 years ago

justLxy commented 2 years ago

Description of Issue

my server crashes after I install the CMI after a while, I'm currently set up with 40G of memory, but the server crashes no matter how big or small the memory is. Yes, I'm using the latest version of cmi and cmilib.

Version Information

--------------------------------------------------
[00:07:24 INFO]: CMI: 9.2.1.4 BungeeCord  SqLite
[00:07:24 INFO]: CMILib: 1.2.1.2 
[00:07:24 INFO]: Server: Paper(794) 1.16.5-R0.1-SNAPSHOT
[00:07:24 INFO]: CMI economy: Disabled CMI Chat: Disabled 
[00:07:24 INFO]: Modules -> 55 enabled 1 disabled: votifier
[00:07:24 INFO]: --------------------------------------------------

Errors

Exception in server tick loop

java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
    at java.base/java.lang.Thread.start0(Native Method)
    at java.base/java.lang.Thread.start(Thread.java:803)
    at java.base/java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:937)
    at java.base/java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1343)
    at java.base/java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:687)
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncScheduler.mainThreadHeartbeat(CraftAsyncScheduler.java:73)
    at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:467)
    at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1432)
    at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436)
    at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1347)
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1135)
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291)
    at java.base/java.lang.Thread.run(Thread.java:834)

Relevant Config Sections

default config

Relevant Plugins

vault 1.7.3

Agreements

Zrips commented 2 years ago

Error does indicate that you run out of memory, double memory usage during server usage. You can do that with /cmi status or any other plugin or software you have available to check this. And how often does this happen? How long it takes for server to crash after start up?

justLxy commented 2 years ago

Error does indicate that you run out of memory, double memory usage during server usage. You can do that with /cmi status or any other plugin or software you have available to check this. And how often does this happen? How long it takes for server to crash after start up?

like 15-20 minutes. I've tried with /cmi status and sometimes the server thread count goes to about 100-3000, or sometimes it goes straight to about 10000.

Zrips commented 2 years ago

What about actual memory usage at that time when it goes to 10000 threads? An no, that amount of threads is not normal. And does this happen with players online or do you experience same crash without anyone or just few?

justLxy commented 2 years ago

What about actual memory usage at that time when it goes to 10000 threads? An no, that amount of threads is not normal. And does this happen with players online or do you experience same crash without anyone or just few?

image image The memory usage is not a lot when the threads reach 10,000+. Yes, the server will crash regardless of any number of players.

Zrips commented 2 years ago

Try running https://www.spigotmc.org/resources/spark.57242/ profiler which might produce some decent results and give some idea whats going on and why you have so many open threads on your server. Other than this its really hard to say, as its quite isolated issue. You could try, if possible, update Java version to v16 or v17, as your v11 is outdated at this point.

mrfloris commented 2 years ago

Step 1 is to properly configure the server, you can review your startup flags for example with https://flags.sh/ Step 2 is to not give it a billion ram, it just means you have more in ram to process by plugins, and things can stack up, memory leaks will build up dramatically, and main thread will get even more delays until plugins that work fine start timing out their scheduled tasks or whatever. Step 3 is to configure the plugin to work with that type of size of the server.