New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft crashing - unable to create thread #83

Open
turijs opened this Issue Nov 29, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@turijs

turijs commented Nov 29, 2018

Ever since upgrading to the latest Minecraft server jar (1.13.2), the server crashes after a few seconds. I am seeing the following in minecraft-stderr.log:

Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
	at java.lang.Thread.start0(Native Method)
	at java.lang.Thread.start(Thread.java:714)
	at java.util.concurrent.CompletableFuture$ThreadPerTaskExecutor.execute(CompletableFuture.java:405)
	at java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1640)
	at java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:1858)
	at com.mojang.datafixers.DataFixerBuilder.build(DataFixerBuilder.java:70)
	at xz.b(SourceFile:140)
	at xz.<clinit>(SourceFile:135)
	at aev$a.a(SourceFile:445)
	at aev.a(SourceFile:131)
	at aev.<clinit>(SourceFile:137)
	at pf.c(SourceFile:470)
	at net.minecraft.server.MinecraftServer.main(SourceFile:794)

I suspect that this has something to do with the way the server wrapper starts the process, because if I manually kick of the server (by running java -Xmx1024M -Xms1024M -jar minecraft_server-run.jar nogui) it works fine.

Any help would be appreciated!

@Raekye

This comment has been minimized.

Member

Raekye commented Dec 4, 2018

Sorry for the late reply. I am looking into this!

@Raekye

This comment has been minimized.

Member

Raekye commented Dec 4, 2018

Hmmm, I'm not able to reproduce the issue myself yet. The only difference between how the server wrapper starts the server and the command above is the -Xms flag. If you're still playing around with it, here's one thing you can try. Open /opt/gamocosm/minecraft.py. On line 35 replace:

cmd = ['java', '-Xmx' + ram, '-jar', 'minecraft_server-run.jar', 'nogui']

with

cmd = ['java', '-Xms' + ram, '-Xmx' + ram, '-jar', 'minecraft_server-run.jar', 'nogui']

(i.e. add the '-Xms' flag).

You can confirm it's working by checking ps aux | grep minecraft when you start the server (via the Gamocosm UI) (before it crashes). It should list the processes running, which should look something like:

mcuser   11105 24.0 54.5 3107092 552488 ?      Sl   20:36   2:02 java -Xmx1024M -jar minecraft_server-run.jar nogui
mcuser   12878  0.0  0.1  11552  1052 pts/0    S+   20:44   0:00 grep --color=auto minecraft

(here you can see it was started as java -Xmx1024M -jar minecraft_server-run.jar nogui).

Also: what size is your server? Is it 1GB ram, or 512MB (i.e. an older server), or more?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment