Skip to content
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

[astralsorcery] Server world first tick crash: OutOfMemoryError: unable to create new native thread #52

Open
Krutoy242 opened this issue Apr 21, 2024 · 8 comments

Comments

@Krutoy242
Copy link

Can't launch server. Every time its launched it crashing with this stack trace:

java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:717)
    at hellfirepvp.astralsorcery.common.starlight.network.TransmissionChain.threadedBuildTransmissionChain(TransmissionChain.java:71)
    at hellfirepvp.astralsorcery.common.starlight.network.TransmissionWorldHandler.buildSourceNetworkThreaded(TransmissionWorldHandler.java:133)
    at hellfirepvp.astralsorcery.common.starlight.network.TransmissionWorldHandler.tick(TransmissionWorldHandler.java:75)
    at hellfirepvp.astralsorcery.common.starlight.network.StarlightTransmissionHandler.tick(StarlightTransmissionHandler.java:49)
    at hellfirepvp.astralsorcery.common.auxiliary.tick.TickManager.worldTick(TickManager.java:55)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_3206_TickManager_worldTick_WorldTickEvent.invoke(.dynamic)

Removing sledgehammer.conf file (this set all changes to 'false') fix and server can run again.

crash-2024-04-21_12.15.59-server.txt

@LXGaming
Copy link
Owner

Interesting, I don't know why it would be throwing an OutOfMemoryError especially as according to the crash report it's only allocated 2392 MB out of 5120 MB of memory, could you please try replacing -Xms2G with -Xms5G in your JVM Flags and see if the issue still occurs.

Could you please attach your debug.log (preferred) or latest.log file.

@LXGaming
Copy link
Owner

I can't reproduce this issue on Windows even when using -Xms1G -Xmx1G so I don't believe it's a memory issue, as you're running Linux I suggest investigating how many threads Java is creating as it may be exceeding limits

https://stackoverflow.com/questions/16789288/java-lang-outofmemoryerror-unable-to-create-new-native-thread

@Krutoy242
Copy link
Author

I cannot reproduce this issue anymore. Seems like it happens on random or somehow related to world or crash reason.

What i know so far:

  • This reason never crashing already running server. If server started fine, it will never crash with same threadedBuildTransmissionChain error
  • I remember that issue on different circumstances could be fixed by itself, with just several server restart

There is debug.log of fine running server, with all config options enabled and xms is 2G as usual debug.log

@Krutoy242
Copy link
Author

I suggest investigating how many threads Java is creating as it may be exceeding limits

Since this issue happens only with Sledge Hammer enabled, could you tell me what exact config option i should disable to fix that? I have only 25 enabled features and i want to keep ones that not causing this crash.

@LXGaming
Copy link
Owner

Try turning off flush-network-on-tick as that patch does create a Thread.

If you do reproduce the issue please provide the debug.log for that run as the OutOfMemoryError could be the result of another error occurring.

I'm assuming you're running docker due to the path /home/container/ in the debug.log, given that this issue is random I'm wondering if it's occurring when the host is under heavy load, I suggest running ulimit -a on the host and inside of a container and note the max user processes value, I believe that this issue is caused by lack of system resources rather than a Sledgehammer issue.

@Krutoy242
Copy link
Author

Krutoy242 commented Apr 22, 2024

Then, i will wait until this crash happens again and provide more logs. I will try to test disabling flush-network-on-tick when this happens.

I suggest running ulimit -a

I cannot run that since I only have access to Pterodactyl control panel. Same, Ptero doesnt give access to max user processes values.

@LXGaming
Copy link
Owner

Oh, If it's a shared host then you might want to contact your server provider about the issue.

@Krutoy242
Copy link
Author

I would better just disable erroring SledgeHammer features rather than mess with server provider 😅
Also, there was other E2EE players who reported similar issue, so i believe this caused by mods rather than hardware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants