Ecliptic Seasons

Ecliptic Seasons

17.4k Downloads

[BUG] Possible Memory Leak/Out of Memory

Closed this issue · 3 comments

commented

Describe the bug
When using ecliptic season to do a large chunk pre-generation such as 10000 x 10000, it often run out of memory and the log points to ecliptic season's heightmap storing/caching.

To Reproduce
Steps to reproduce the behavior:

  1. Download Chunky and Ecliptic Season.
  2. Play both of them and use Chunky to generate a large radius.
  3. Wait for the generation to be completed.
  4. Notice the memory usage is extremely high despite restart.

Expected behavior
Does not have memory leak or out of memory crash during world generation.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform(please complete the following information):

  • Minecraft Verison: 1.20.1
  • Platform Verison: Forge 47.4.0
  • Mod Version: EclipticSeasons-1.20.1-forge-0.12.0-pre4-all

Additional context
Currently, it looks like removing Ecliptic Season, the ram usage for the server from 15GB jumped back to 6GB, essentially removing a lot of ram usage. It is very likely ecliptic season is storing some kind of information and memory got out of hand when the map got bigger and more chunks generated.

Here's some spark heap summary if it helps:
With Ecliptic Season:
https://spark.lucko.me/yRVOIxdMqo or
https://spark.lucko.me/J0k4ma7wxA
Image

Without Ecliptic Season:
https://spark.lucko.me/tvtCFbDWe7
Image

Debug Log:
debug (14).log

Crash Error:

[14:38:17] [Worker-Main-6/ERROR] [minecraft/Util]: Caught exception in thread Thread[Worker-Main-6,1,main]
java.lang.OutOfMemoryError: Java heap space
        at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.clone(Long2ObjectOpenHashMap.java:1332) ~[fastutil-8.5.9.jar%2390!/:?] {re:mixin}
        at net.minecraft.world.level.lighting.BlockLightSectionStorage$BlockDataLayerStorageMap.m5972(BlockLightSectionStorage.java:36) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.world.level.lighting.BlockLightSectionStorage$BlockDataLayerStorageMap.m5972(BlockLightSectionStorage.java:29) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.world.level.lighting.LayerLightSectionStorage.m75790(LayerLightSectionStorage.java:287) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:mixin,re:classloading,pl:mixin:APP:eclipticseasons.mixins.json:common.level.MixinLayerLightSectionStorage,pl:mixin:A}
        at net.minecraft.world.level.lighting.LightEngine.m9323(LightEngine.java:153) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.world.level.lighting.LevelLightEngine.m9323(LevelLightEngine.java:53) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.server.level.ThreadedLevelLightEngine.m9366(ThreadedLevelLightEngine.java:187) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.server.level.ThreadedLevelLightEngine.m215156(ThreadedLevelLightEngine.java:166) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.server.level.ThreadedLevelLightEngine$$Lambda$38152/0x00007f28602944a8.run(Unknown Source) ~[?:?] {}
        at net.minecraft.util.thread.ProcessorMailbox.m18759(ProcessorMailbox.java:91) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.util.thread.ProcessorMailbox.m18747(ProcessorMailbox.java:146) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
        at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:102) ~[server-1.20.1-20230612.114412-srg.jar%23551!/:?] {re:classloading}
commented

The current version is applying a patch. Our mod was not designed for this scenario.

commented

And it is plug-and-play and does not need to be used during world generation. In fact, due to seasonal effects, I think it’s best not to include the seasonal mod in pre-generated worlds, to avoid some mods generating winter chunks.

commented

should fix in #0.12pre7-3