Astral Sorcery

Astral Sorcery

63M Downloads

java.lang.OutOfMemoryError in bigger modpack

iComputerfreak opened this issue ยท 8 comments

commented

When using Astral Sorcery in my custom modpack, the server crashes with an OutOfMemoryError on almost every start.
Here is the stack trace

[15:26:24] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
java.lang.OutOfMemoryError: unable to create new native thread
	at java.lang.Thread.start0(Native Method) ~[?:1.8.0_181]
	at java.lang.Thread.start(Thread.java:717) ~[?:1.8.0_181]
	at hellfirepvp.astralsorcery.common.starlight.network.TransmissionChain.threadedBuildTransmissionChain(TransmissionChain.java:67) ~[TransmissionChain.class:?]
	at hellfirepvp.astralsorcery.common.starlight.network.TransmissionWorldHandler.buildSourceNetworkThreaded(TransmissionWorldHandler.java:133) ~[TransmissionWorldHandler.class:?]
	at hellfirepvp.astralsorcery.common.starlight.network.TransmissionWorldHandler.tick(TransmissionWorldHandler.java:75) ~[TransmissionWorldHandler.class:?]
	at hellfirepvp.astralsorcery.common.starlight.network.StarlightTransmissionHandler.tick(StarlightTransmissionHandler.java:49) ~[StarlightTransmissionHandler.class:?]
	at hellfirepvp.astralsorcery.common.auxiliary.tick.TickManager.worldTick(TickManager.java:55) ~[TickManager.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1351_TickManager_worldTick_WorldTickEvent.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:274) ~[FMLCommonHandler.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:776) ~[MinecraftServer.class:?]
	at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397) ~[nz.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) ~[MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

I started the server with the -Xmx8G argument and the memory stayed below that limit all the time. The number of threads stayed under the user and system limit too.

Forge version: 14.23.4.2760 (Minecraft 1.12.2)

My Java version:

mc@h*******:~$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.18.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

My Ubuntu version:

mc@h*******:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic
commented

Sounds like you need to allocate more memory. I run atm3 on 4gb, so...

What pack and version? Full log into pastebin ease. Dont put raw logs into a ticket.

commented

At least read the message of the JVM error: unable to create new native thread

either you have a massive amount of crystals around which floods your threadpool to hit jvm's default limit during resolving their networks (by that i mean literally ~100.000 of them all loading instantly at the same time)
or you have a very low default threadlimit on your JVM
or maybe that OpenJDK is not yet fully binary compatible with Oracles jvm.

But since you seemingly wanted to tell me that you've already checked the configuration issues, i'll on that regard either blame it on settings in openjdk or 'idk' - this is not a java issue as you've pointed out - assuming you've monitored it closely and (on a time sample regard) accurately enough.

commented

I have allocated 8 GB of RAM, and it barely uses 5 or 6 GB of it. The modpack is a custom one. I have uploaded the log here: Pastebin and the crash report here: Pastebin.

About the JVM error: Yes, I read the "unable to create new native thread", but the thread limits per user and systemwide are not nearly reached. My user limit is at more than 700 thousand threads per user and when watching top, the threads barely climbed up to 400. And since the JVM also had more than enough memory, I didn't know why there even was an OutOfMemoryError.

About the massive amount of crystals: We didn't start using Astral Sorcery yet, so the only thing there is, are the crystals that are spawned due to world generation and even those are not chunk loaded.

About OpenJDK: I also tried the Oracle JDK. A switch from Oracle to OpenJDK fixed the OOME for a few days but today it occured again.

If you need the modpack, I would need to prepare it first (it contains some pictures that are under copyright) and upload it somewhere public.

commented

modlist would suffice, but I don't honestly think it will help here, since this isn't likely to be a mod-based issue unless there's something really weird going on as an interaction.

Have you tried going back to an earlier version, like maybe going back to 151?

commented

Ok. I still can't be sure that the problem is not on my server or with java, so I guess there is not too much you can do and I will write back, if I got a clue what the problem could be.

commented

I can try that on the weekend. This week is a bit packed for me.

commented

I'm seeing quite a few reports in different mods and modpacks of people having various allocation issues while running the 181 release of java 1.8. Have you had a chance to look into an earlier release version?

commented

So yesterday the OOME occured again, without the mod installed. It seems, that there is something wrong with my server in general and Astral Sorcery was just the one thread, that broke the limit. Still I couldn't figure out what limit (since all that I know are set high enough) so I just trashed my whole server and did a fresh install. Since then I had no more OOMEs.

Sorry for bothering you and thanks for the help. It seems, the problem was on my server from the beginning.