Starlight (Fabric)

Starlight (Fabric)

18M Downloads

Java heap space problem - Starlight

misuda12 opened this issue ยท 1 comments

commented

Hello fellow developers,

After some debugging we have experienced many server crashes with reason: Java heap space
We have generated heap report and seems like we have way too many chunks loaded.
Is there a way to tweak this LightingFeature from our side besides forking and removing this feature ?
Seems like starlight in 1.18.1 uses way to much RAM by loading chunks that are not unloaded then

Stacktrace:
java.util.concurrent.CompletionException: java.lang.OutOfMemoryError: Java heap space at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) at ca.spottedleaf.starlight.common.light.StarLightInterface.propagateChanges(StarLightInterface.java:534) at net.minecraft.server.level.ThreadedLevelLightEngine.runUpdate(ThreadedLevelLightEngine.java:530) at net.minecraft.server.level.ThreadedLevelLightEngine.lambda$tryScheduleUpdate$27(ThreadedLevelLightEngine.java:510) at net.minecraft.util.thread.ProcessorMailbox.pollTask(ProcessorMailbox.java:91) at net.minecraft.util.thread.ProcessorMailbox.pollUntil(ProcessorMailbox.java:146) at net.minecraft.util.thread.ProcessorMailbox.run(ProcessorMailbox.java:102) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.OutOfMemoryError: Java heap space at ca.spottedleaf.starlight.common.light.SWMRNibbleArray.updateVisible(SWMRNibbleArray.java:334) at ca.spottedleaf.starlight.common.light.StarLightEngine.updateVisible(StarLightEngine.java:267) at ca.spottedleaf.starlight.common.light.StarLightEngine.checkChunkEdges(StarLightEngine.java:861) at ca.spottedleaf.starlight.common.light.StarLightInterface.checkSkyEdges(StarLightInterface.java:472) at ca.spottedleaf.starlight.common.light.StarLightInterface.checkChunkEdges(StarLightInterface.java:463) at net.minecraft.server.level.ThreadedLevelLightEngine.lambda$lightChunk$20(ThreadedLevelLightEngine.java:451) at net.minecraft.server.level.LightEngineThreaded$$Lambda$6811/0x0000000802101a88.get(Unknown Source) at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) at ca.spottedleaf.starlight.common.light.StarLightInterface.propagateChanges(StarLightInterface.java:534) at net.minecraft.server.level.ThreadedLevelLightEngine.runUpdate(ThreadedLevelLightEngine.java:530) at net.minecraft.server.level.ThreadedLevelLightEngine.lambda$tryScheduleUpdate$27(ThreadedLevelLightEngine.java:510) at net.minecraft.server.level.LightEngineThreaded$$Lambda$6814/0x00000008021027c8.run(Unknown Source)

-- System Details --
Details:
Minecraft Version: 1.18.1
Minecraft Version ID: 1.18.1
Operating System: Linux (amd64) version 5.4.0-87-generic
Java Version: 17.0.1, Oracle Corporation
Java VM Version: OpenJDK 64-Bit Server VM (mixed mode, sharing), Oracle Corporation
Memory: 6693547008 bytes (6383 MiB) / 21474836480 bytes (20480 MiB) up to 21474836480 bytes (20480 MiB)
CPUs: 32
Processor Vendor: AuthenticAMD
Processor Name: AMD Ryzen 9 5950X 16-Core Processor
Identifier: AuthenticAMD Family 25 Model 33 Stepping 0
Microarchitecture: Zen 3
Frequency (GHz): -0.00
Number of physical packages: 1
Number of physical CPUs: 16
Number of logical CPUs: 32
Graphics card #0 name: GK208B [GeForce GT 710]
Graphics card #0 vendor: NVIDIA Corporation (0x10de)
Graphics card #0 VRAM (MB): 160.00
Graphics card #0 deviceId: 0x128b
Graphics card #0 versionInfo: unknown
Virtual memory max (MB): 64388.73
Virtual memory used (MB): 93875.01
Swap memory total (MB): 0.00
Swap memory used (MB): 0.00
JVM Flags: 21 total; -Xms20G -Xmx20G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -XX:ParallelGCThreads=6

commented

// close: Made issue in wrong repository