mojira.dev
MC-239682

Out of memory crash: World generation exhausts Java heap space

When creating a world using a redstone mechanism, the game crashed after about 24 hours with an out of memory exception.

Crash report is attached.

To reproduce:
1. Create a new world in creative mode (I used seed 1, gamerules: doWeatherCycle=false, doDaylightCycle=false, commandBlockOutput=false).
2. Unzip the attach file "g18.zip" into the "generated" folder of the save file.
3. Use a structure block to load the redstone mechanism "g18" into the spawn chunks of the Overworld.
4. Start the mechanism and let it run for a while, 24 hours or more. Eventually the game will crash.

Attachments

Comments 11

Affects 21w44a. I got the following errors in the log:

18:14:51.026 Worker-Main-5 died java.lang.OutOfMemoryError: Java heap space
18:14:51.027 Caught exception in thread Thread[IO-Worker-22,5,main] java.lang.OutOfMemoryError: Java heap space
18:14:51.033 Caught exception in thread Thread[Worker-Main-5,5,main] java.lang.OutOfMemoryError: Java heap space

This is easy to reproduce in under two hours if the heap size is limited to 1GB with "-xmx1G". The complete list of JVM options used were: -Xmx1G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M

Can confirm in 1.18 Pre-release 1.

Related issues:

  • MC-182904 Chunks stop generating and commands no longer work after several hours

  • MC-130162 Exception generating new chunk - OutOfMemoryError: Java heap space (32 bit Java)

  • MC-128163 Worldgen worker thread crash - Out of Memory error

Confirmed 1,18 pre-release 2 (memory at 100% after 3 minutes exploring, chunks stop loading game crashes. (8 gb of ram)

When you exit the game it takes ages to save,, seems likely that this is related too.

Not resolved, 1.18 pre-release 5

 

1 more comments

I can upload a screenshot of the F3 screen staying at 100% at 8gig memory and the game struggling to load chunks afterwards, but that won't help you much. Only difference is that saving the world file doesn't take 5 minutes anymore.

Pre 1.18 world (world that ran pretty smooth with a big town up to 1.18 snapshots. I do my testing in java 17.0.1, Windows 10. When I explore pure new chunks the way up to 100% and crash takes longer. When I explore existing chunks and builds it only takes 2 minutes. Fps stays pretty stable though.

then report it and stop being cryptic

Still an issue in 1.18 full release. (single player)

"Fixed"

Clearly it wasn't. Multiple users are reporting similar performance issues.

This should be reopened instead of resolved.

bdm68

(Unassigned)

Plausible

Very Important

Crash

21w42a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 2

1.18 Pre-release 3

Retrieved