BramStoutProductions / MiEx

A modern Minecraft Exporter
BSD 3-Clause "New" or "Revised" License
61 stars 9 forks source link

OutofMemoryError when loading some worlds #13

Closed JamesMonkey closed 7 months ago

JamesMonkey commented 7 months ago

When loading a world in MiEx v1.2.1, most of the chunks load perfectly. However, the program seems to hang on some chunks that render black, resulting in a log error. Below are two different logs for two different worlds that seem to share similar out-of-memory errors.

Log 1 Exception in thread "Threadpool-5" Exception in thread "Threadpool-13" Exception in thread "Threadpool-18" Exception in thread "Threadpool-21" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-16" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space at nl.bramstout.mcworldexporter.nbt.TAG_Long_Array.parse(TAG_Long_Array.java:54) at nl.bramstout.mcworldexporter.nbt.NBT_Tag.make(NBT_Tag.java:111) at nl.bramstout.mcworldexporter.nbt.TAG_Compound.parse(TAG_Compound.java:51) at nl.bramstout.mcworldexporter.nbt.NBT_Tag.make(NBT_Tag.java:111) at nl.bramstout.mcworldexporter.nbt.TAG_Compound.parse(TAG_Compound.java:51) at nl.bramstout.mcworldexporter.nbt.TAG_List.parse(TAG_List.java:113) at nl.bramstout.mcworldexporter.nbt.NBT_Tag.make(NBT_Tag.java:111) at nl.bramstout.mcworldexporter.nbt.TAG_Compound.parse(TAG_Compound.java:51) at nl.bramstout.mcworldexporter.nbt.NBT_Tag.make(NBT_Tag.java:111) at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:111) at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174) at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260) at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121) at java.lang.Thread.run(Unknown Source) java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-19" Exception in thread "Threadpool-7" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:182) at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174) at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260) at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121) at java.lang.Thread.run(Unknown Source) java.lang.OutOfMemoryError: Java heap space

Log 2 Exception in thread "Threadpool-19" Exception in thread "Threadpool-6" Exception in thread "Threadpool-0" Exception in thread "Threadpool-3" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:182) at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174) at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260) at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121) at java.lang.Thread.run(Unknown Source) Exception in thread "Threadpool-15" java.lang.OutOfMemoryError: Java heap space at nl.bramstout.mcworldexporter.world.anvil.ChunkAnvil._load(ChunkAnvil.java:182) at nl.bramstout.mcworldexporter.world.Chunk.load(Chunk.java:174) at nl.bramstout.mcworldexporter.ui.Renderer2D$LoadChunkTask.run(Renderer2D.java:260) at nl.bramstout.mcworldexporter.parallel.ThreadPool$Worker.run(ThreadPool.java:121) at java.lang.Thread.run(Unknown Source) java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-13" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-2" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-8" Exception in thread "Threadpool-4" Exception in thread "Threadpool-9" Exception in thread "Threadpool-21" Exception in thread "Threadpool-28" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-18" Exception in thread "Threadpool-1" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-11" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-29" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-24" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-16" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-20" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-26" Exception in thread "Threadpool-12" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-27" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-17" java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-22" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-14" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-10" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-25" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-5" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-23" java.lang.OutOfMemoryError: Java heap space Exception in thread "Threadpool-7" java.lang.OutOfMemoryError: Java heap space

BramStout commented 7 months ago

I have just released a new version which more aggressively unloads chunks in order to reduce peak memory usage. I'd also recommend to make sure that you can running MiEx using a 64 bit version of Java and not a 32 bit version of Java.

Please let me know if this new version improves things!

JamesMonkey commented 7 months ago

..I can't believe I had 32 bit java installed. The latest update combined with Java 64 bit resolved this issue. Thank ya sir!