Concurrent Chunk Management Engine (Fabric)

Concurrent Chunk Management Engine (Fabric)

231k Downloads

Server sometimes crashes on startup (unable to create native thread)

Azarattum opened this issue ยท 2 comments

commented

Describe the bug
Sometimes c2me is unable to create threads which causes a server to crash. This happens approximately 3/4 times when trying to start the serever.

Expected behavior
Properly allocate resources or maybe silently fail (without a server crash).

Runtime info:

  • OS: Linux cont10804 2.6.32-042stab145.3
  • Minecraft version: 1.19.2
  • Mod version: c2me-fabric-mc1.19.2-0.2.0+alpha.8.37.jar
  • JVM args: -mx2300M -Xmx2300M -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+UseCompressedOops -XX:+UseNUMA -XX:G1NewSizePercent=10 -XX:G1ReservePercent=10 -XX:G1HeapRegionSize=32M -XX:G1MaxNewSizePercent=10 -XX:G1HeapWastePercent=10 -XX:+UnlockExperimentalVMOptions -XX:+OptimizeStringConcat -XX:+AlwaysPreTouch -XX:+ScavengeBeforeFullGC -XX:+UseFastJNIAccessors -XX:+UseCodeCacheFlushing -XX:+TieredCompilation -XX:+UseSuperWord -XX:+OptimizeFill -XX:LoopUnrollMin=4 -XX:LoopMaxUnroll=16 -XX:+UseLoopPredicate -XX:+RangeCheckElimination -XX:InitiatingHeapOccupancyPercent=10
  • RAM: 3G
  • Using MSH to start the server

Crash reports / logs

java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'c2me'!
	at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.lambda$invoke0$0(EntrypointUtils.java:51) ~[fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) ~[fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:49) ~[fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke(EntrypointUtils.java:35) ~[fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.Hooks.startServer(Hooks.java:62) ~[fabric-loader-0.14.9.jar:?]
	at net.minecraft.server.Main.main(Main.java:101) [server-intermediary.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.14.9.jar:?]
	at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69) [server.jar:0.11.1]
Caused by: java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached
	at java.lang.Thread.start0(Native Method) ~[?:?]
	at java.lang.Thread.start(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture$ThreadPerTaskExecutor.execute(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.asyncSupplyStage(Unknown Source) ~[?:?]
	at java.util.concurrent.CompletableFuture.supplyAsync(Unknown Source) ~[?:?]
	at com.ishland.c2me.C2MEMod.lambda$consistencyTest$1(C2MEMod.java:82) ~[c2me-fabric-mc1.19.2-0.2.0+alpha.8.37.jar:?]
	at java.util.stream.IntPipeline$1$1.accept(Unknown Source) ~[?:?]
	at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Unknown Source) ~[?:?]
	at java.util.Spliterator$OfInt.forEachRemaining(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline.toArray(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline.toList(Unknown Source) ~[?:?]
	at com.ishland.c2me.C2MEMod.consistencyTest(C2MEMod.java:89) ~[c2me-fabric-mc1.19.2-0.2.0+alpha.8.37.jar:?]
	at com.ishland.c2me.C2MEMod.onInitialize(C2MEMod.java:44) ~[c2me-fabric-mc1.19.2-0.2.0+alpha.8.37.jar:?]
	at net.fabricmc.loader.impl.entrypoint.EntrypointUtils.invoke0(EntrypointUtils.java:47) ~[fabric-loader-0.14.9.jar:?]
	... 8 more

Checklist

  • I am using the official version of the mod.
  • I tried the latest development version but the issue persists.
  • I searched for similar open issues and could not find an existing bug report on this.
commented

You don't have enough ram for the mod; this is a duplicate of another issue.

Other advices:
-3GB of ram isn't enough for the usage you have as you allocate 2,3GB to Java and in a world we suppose there is no JVM overhead (don't remember the exact translation sorry) it leaves only 700MB to Linux to operate and we continue to suppose you don't run any other stuff.
-your linux kernel is very old, you might want to upgrade.

commented

@toinouH thanks for your answer. 700mb is more than enough for the rest of the system to properly function. It uses approximately ~200mb when the server isn't running. I'm aware that the kernel is super old, unfortunately I don't have an option to update it, since this is a limitation of my VPS provider.

So, is there a way to run the mod with my configuration? It runs great when it manages to start up. The only issue is the potential crash during the booting. If we are passed that the mod will function properly. I think, I also used to run 1.17.1 version of the mod on the same machine about half a year ago and it worked without an issue.