EnigmaticaModpacks / Enigmatica6

The official repository and issue-tracker for Enigmatica 6
https://www.curseforge.com/minecraft/modpacks/enigmatica6
240 stars 525 forks source link

Repeatable out of memory condition #4469

Open Old-Man-D opened 2 years ago

Old-Man-D commented 2 years ago

Modpack Version

Expert 1.0.0

Describe your issue.

I am having this reoccurring out of memory condition that keeps closing out my session, forcing me to restart the client to resolve. It occurs after a few hours of playing, usually about 2-3 hours. I have tried allocating between 8 and 14 GB of ram, I have 32 total. nothing seems to change in regards to this crash.

Crash Report

No response

Latest Log

https://gist.github.com/Old-Man-D/0ed6e20f6f07ada509c4176a6983371e

Have you modified the modpack?

Yes

User Modifications

I have added optifine and the mod "Item Zoom". The Item zoom mod is a recent addition, it was crashing before it was added. I am willing to dump optifine, but the last time I loaded up without it, the emoji mod crashed me within minutes.

Did the issue happen in singleplayer or on a server?

Server

NielsPilgaard commented 2 years ago

I'm afraid we have no control over which Java version is bundled with launchers, nor which version is picked.

Old-Man-D commented 2 years ago

Java 16 seems to have fixed my crash as well. I wonder what the underlying issue is that the java change seems to resolve. On a side note, now I am getting an infrequent crash from the emoji mod, but that's another issue.

ALainxD commented 2 years ago

So useing Java 16 should completely solve the issue? Can someone link me the download?

Old-Man-D commented 2 years ago

It appears to have solved the issue for me, I have not had a single out of memory crash since using java 16

ALainxD commented 2 years ago

Like 50% of the people playing on my server get out of memory after a few hours

Schweigsam83 commented 2 years ago

Hi again, java 17.1 seems to work as well. and the pro of this: its coming with vanilla minecraft 18 in the runtime lib as "beta" so no need for an oracle account.

johnnylingster commented 2 years ago

Hats sweet. But, won't that only help with enigmatica 8? 6 is 1.16 minecraft.

On Sat, Apr 16, 2022, 8:47 AM Schweigsam83 @.***> wrote:

Hi again, java 17.1 seems to work as well. and the pro of this: its coming with vanilla minecraft 18 in the runtime lib as "beta" so no need for an oracle account.

— Reply to this email directly, view it on GitHub https://github.com/EnigmaticaModpacks/Enigmatica6/issues/4469#issuecomment-1100656052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLUWGHQZBMGZPABBBZUFIDVFKZFDANCNFSM5RKIP2IQ . You are receiving this because you commented.Message ID: @.***>

Schweigsam83 commented 2 years ago

yeah thats the reason for multimc. it works around the java restrictions

Darkere commented 2 years ago

Newer java download can be found here: https://adoptium.net/

Curseforge does not currently support using a different java version on 1.16. Multimc and Gdlaucher both work though.

You'll need these two arguments to make 1.16 run with java 16+, unless the launcher takes care of that. --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.base/java.util.jar=ALL-UNNAMED

Home
Eclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.
XenonDB commented 2 years ago

After lots of researching, I think I found the reason of this issue. More specifically, this issue is "Memory leaking of direct memory (a type of non-heap memory, allocated by netty)"

These are some important logs during researching. Researching start from here, this is logs in latest.log after disconnecting from server:

[14Apr2022 04:22:20.659] [Render thread/INFO] [journeymap/]: Loaded 5 waypoints from E:\backup\Minecraft\MultiMC\instances\Enigmatica 6 Expert - E6E\minecraft\journeymap\data\mp\Yuzu~Server_bd6fa82d~2efb~4966~8633~28a2b07c01ff\waypoints
[14Apr2022 04:22:20.659] [Render thread/INFO] [journeymap/]: Mapping started in E:\backup\Minecraft\MultiMC\instances\Enigmatica 6 Expert - E6E\minecraft\journeymap\data\mp\Yuzu~Server_bd6fa82d~2efb~4966~8633~28a2b07c01ff\overworld. Memory: 6110MB total, 1924MB free 
[14Apr2022 04:23:49.038] [Render thread/INFO] [net.minecraft.client.gui.NewChatGui/]: [CHAT] Sending 79 Lapis Lazuli
[14Apr2022 04:26:28.989] [Render thread/ERROR] [Chisel/]: java.lang.NullPointerException
[14Apr2022 04:26:30.354] [Render thread/ERROR] [Chisel/]: java.lang.NullPointerException
[14Apr2022 04:26:50.042] [Render thread/ERROR] [Chisel/]: java.lang.NullPointerException
[14Apr2022 04:26:55.681] [Render thread/INFO] [net.minecraft.client.gui.NewChatGui/]: [CHAT] Sending 1 sets of ingredients
[14Apr2022 04:30:36.416] [Render thread/INFO] [Astral Sorcery/]: Client cache cleared!
[14Apr2022 04:30:36.429] [Render thread/INFO] [journeymap/]: Mapping halted in E:\backup\Minecraft\MultiMC\instances\Enigmatica 6 Expert - E6E\minecraft\journeymap\data\mp\Yuzu~Server_bd6fa82d~2efb~4966~8633~28a2b07c01ff\minecraft:overworld
[14Apr2022 04:30:38.318] [Render thread/FATAL] [net.minecraft.client.Minecraft/]: Out of memory
io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 3002 byte(s) of direct memory (used: 6407584479, max: 6407585792)
    at io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:640) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:594) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledUnsafeNoCleanerDirectByteBuf.java:30) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledByteBufAllocator.java:186) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledUnsafeDirectByteBuf.<init>(UnpooledUnsafeDirectByteBuf.java:68) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledUnsafeNoCleanerDirectByteBuf.java:25) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledByteBufAllocator.java:181) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:91) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:185) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnsafeByteBufUtil.copy(UnsafeByteBufUtil.java:436) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.UnpooledUnsafeDirectByteBuf.copy(UnpooledUnsafeDirectByteBuf.java:463) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at io.netty.buffer.AbstractByteBuf.copy(AbstractByteBuf.java:1170) ~[netty-all-4.1.25.Final.jar:4.1.25.Final]
    at net.minecraft.network.PacketBuffer.copy(PacketBuffer.java:1009) ~[?:?]
    at net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_180735_b(SCustomPayloadPlayPacket.java:69) ~[?:?]
    at net.minecraft.client.network.play.ClientPlayNetHandler.func_147240_a(ClientPlayNetHandler.java:1692) ~[?:?]
    at net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_148833_a(SCustomPayloadPlayPacket.java:59) ~[?:?]
    at net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_148833_a(SCustomPayloadPlayPacket.java:11) ~[?:?]
    at net.minecraft.network.PacketThreadUtil.func_225383_a(SourceFile:21) ~[?:?]
    at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) ~[?:?]
    at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?]
    at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) ~[?:?]
    at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103) ~[?:?]
    at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:948) ~[?:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) ~[?:?]
    at net.minecraft.client.main.Main.main(Main.java:184) ~[minecraft-1.16.5-client.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_292]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
    at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.2.29-launcher.jar:36.2]
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?]
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?]
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?]
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_292]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
    at io.github.zekerzhayard.forgewrapper.installer.Main.main(Main.java:57) [ForgeWrapper-mmc3.jar:mmc3]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_292]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_292]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_292]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210) [NewLaunch.jar:?]
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245) [NewLaunch.jar:?]
    at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
    at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]

This stack trace indicate this issue may be relative with direct memory. After searching and learning document, posts about this, I supposed that "direct memory leaking" may happened. And I add this argument for debugging: -Dio.netty.leakDetection.level=advanced This is the argument which is designed for direct memory leaking detection by netty. And I use vanilla launcher to start E6E, with Open output log when Minecraft: Java Edition starts to check the log output by netty and found lots of things like this:(check full log in launcher_log.txt)

[Info: 2022-04-16 08:17:24.1335803: GameCallbacks.cpp(177)] Game/game () Info SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
[Info: 2022-04-16 08:17:24.1336244: GameCallbacks.cpp(177)] Game/game () Info Recent access records:
[Info: 2022-04-16 08:17:24.1392689: GameCallbacks.cpp(177)] Game/game () Info Created at:
[Info: 2022-04-16 08:17:24.1393599: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:331)
[Info: 2022-04-16 08:17:24.1393935: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:185)
[Info: 2022-04-16 08:17:24.1394232: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.UnsafeByteBufUtil.copy(UnsafeByteBufUtil.java:436)
[Info: 2022-04-16 08:17:24.1394517: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.PooledUnsafeDirectByteBuf.copy(PooledUnsafeDirectByteBuf.java:309)
[Info: 2022-04-16 08:17:24.1394799: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.AbstractByteBuf.copy(AbstractByteBuf.java:1170)
[Info: 2022-04-16 08:17:24.1395086: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.PacketBuffer.copy(PacketBuffer.java:1344)
[Info: 2022-04-16 08:17:24.1395366: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_180735_b(SCustomPayloadPlayPacket.java:69)
[Info: 2022-04-16 08:17:24.1395647: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.client.network.play.ClientPlayNetHandler.func_147240_a(ClientPlayNetHandler.java:1692)
[Info: 2022-04-16 08:17:24.1395930: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_148833_a(SCustomPayloadPlayPacket.java:59)
[Info: 2022-04-16 08:17:24.1396209: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.play.server.SCustomPayloadPlayPacket.func_148833_a(SCustomPayloadPlayPacket.java:11)
[Info: 2022-04-16 08:17:24.1396489: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:36)
[Info: 2022-04-16 08:17:24.1396768: GameCallbacks.cpp(177)] Game/game () Info net.optifine.util.PacketRunnable.run(PacketRunnable.java:28)
[Info: 2022-04-16 08:17:24.1397048: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(ThreadTaskExecutor.java:189)
[Info: 2022-04-16 08:17:24.1397844: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)
[Info: 2022-04-16 08:17:24.1398264: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(ThreadTaskExecutor.java:151)
[Info: 2022-04-16 08:17:24.1398573: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(ThreadTaskExecutor.java:128)
[Info: 2022-04-16 08:17:24.1398861: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:948)
[Info: 2022-04-16 08:17:24.1399143: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607)
[Info: 2022-04-16 08:17:24.1399424: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.client.main.Main.main(Main.java:184)
[Info: 2022-04-16 08:17:24.1399704: GameCallbacks.cpp(177)] Game/game () Info sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[Info: 2022-04-16 08:17:24.1399987: GameCallbacks.cpp(177)] Game/game () Info sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[Info: 2022-04-16 08:17:24.1400274: GameCallbacks.cpp(177)] Game/game () Info sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[Info: 2022-04-16 08:17:24.1400561: GameCallbacks.cpp(177)] Game/game () Info java.lang.reflect.Method.invoke(Method.java:498)
[Info: 2022-04-16 08:17:24.1400840: GameCallbacks.cpp(177)] Game/game () Info net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51)
[Info: 2022-04-16 08:17:24.1401182: GameCallbacks.cpp(177)] Game/game () Info cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37)
[Info: 2022-04-16 08:17:24.1401499: GameCallbacks.cpp(177)] Game/game () Info cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54)
[Info: 2022-04-16 08:17:24.1401781: GameCallbacks.cpp(177)] Game/game () Info cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72)
[Info: 2022-04-16 08:17:24.1402061: GameCallbacks.cpp(177)] Game/game () Info cpw.mods.modlauncher.Launcher.run(Launcher.java:82)
[Info: 2022-04-16 08:17:24.1402339: GameCallbacks.cpp(177)] Game/game () Info cpw.mods.modlauncher.Launcher.main(Launcher.java:66)
[Info: 2022-04-16 08:17:24.1402763: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1403386: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1622360: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1661599: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1662439: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1662760: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1680646: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1681735: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1709016: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1710030: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1714930: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1715585: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1717117: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1717649: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1719480: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1728809: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.1736665: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.1741725: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2016667: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2017754: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2052016: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2052854: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2075261: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2076328: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2282722: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2283800: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2324378: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2325484: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.2452120: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.2453205: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.4911678: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/INFO] [ne.mi.co.Co.astralsorcery/COREMODLOG]: Adding 'add_custom_voxel_collision' ASM patch...
[Info: 2022-04-16 08:17:24.4987211: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/INFO] [ne.mi.co.Co.astralsorcery/COREMODLOG]: Added 'add_custom_voxel_collision' ASM patch!
[Info: 2022-04-16 08:17:24.5015991: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/INFO] [ne.mi.co.Co.astralsorcery/COREMODLOG]: Adding 'add_custom_collision_flag' ASM patch...
[Info: 2022-04-16 08:17:24.5027615: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/INFO] [ne.mi.co.Co.astralsorcery/COREMODLOG]: Added 'add_custom_collision_flag' ASM patch!
[Info: 2022-04-16 08:17:24.6172533: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.6174608: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.6178883: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.6179458: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.6208869: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.6383317: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.6384241: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.6384570: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:24.6384864: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Sound engine/WARN] [minecraft/SoundSystem]: Maximum sound pool size 247 reached
[Info: 2022-04-16 08:17:24.6385212: GameCallbacks.cpp(177)] Game/game () Info [16:17:24] [Render thread/WARN] [minecraft/SoundEngine]: Failed to create new sound handle
[Info: 2022-04-16 08:17:25.6008625: GameCallbacks.cpp(177)] Game/game () Info Apr 16, 2022 4:17:25 PM io.netty.util.ResourceLeakDetector reportTracedLeak
[Info: 2022-04-16 08:17:25.6009504: GameCallbacks.cpp(177)] Game/game () Info SEVERE: LEAK: ByteBuf.release() was not called before it's garbage-collected. See http://netty.io/wiki/reference-counted-objects.html for more information.
[Info: 2022-04-16 08:17:25.6009852: GameCallbacks.cpp(177)] Game/game () Info Recent access records:
[Info: 2022-04-16 08:17:25.6010142: GameCallbacks.cpp(177)] Game/game () Info #1:
[Info: 2022-04-16 08:17:25.6010423: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.AdvancedLeakAwareByteBuf.readByte(AdvancedLeakAwareByteBuf.java:400)
[Info: 2022-04-16 08:17:25.6010710: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.network.PacketBuffer.readByte(PacketBuffer.java:1019)
[Info: 2022-04-16 08:17:25.6010996: GameCallbacks.cpp(177)] Game/game () Info io.netty.buffer.ByteBufInputStream.readByte(ByteBufInputStream.java:208)
[Info: 2022-04-16 08:17:25.6011281: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.nbt.CompoundNBT.func_152447_a(CompoundNBT.java:414)
[Info: 2022-04-16 08:17:25.6011561: GameCallbacks.cpp(177)] Game/game () Info net.minecraft.nbt.CompoundNBT.func_229676_a_(CompoundNBT.java:31)

I checked SCustomPayloadPlayPacket.class and ClientPlayNetHandler.class and found: 1 2 5

getData() will make a copy of ByteBuf by calling its copy() method, which will let java acquire a new direct memory from operating system. Since direct memory isn't managed by GC, it should be released manually. However: 3 4 I can't understand why forge removed release() here.

This may be the reason of this issue.


By the way

Java 16 seems to have fixed my crash as well. I wonder what the underlying issue is that the java change seems to resolve. On a side note, now I am getting an infrequent crash from the emoji mod, but that's another issue.

The reason may be that netty will be forced to use Cleaner for direct byte buffer because NoCleaner mode isn't supported in Java 16:(Cleaner is an automatic direct memory recycler) 6 7 8

Here is the heap dump for UnpooledByteBufAllocator in Java 8: 9-1 and in Java 16: 9-2

Code in PlatformDependent.class also shown that If system parameter "io.netty.maxDirectMemory" is 0 (-Dio.netty.maxDirectMemory=0), netty will be forced to not use NoCleaner mode.

Thus, add argument -Dio.netty.maxDirectMemory=0 may solve this issue

Reference: https://learn.lianglianglee.com/%E4%B8%93%E6%A0%8F/Netty%20%E6%A0%B8%E5%BF%83%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E4%B8%8E%20RPC%20%E5%AE%9E%E8%B7%B5-%E5%AE%8C/10%20%20%E5%8F%8C%E5%88%83%E5%89%91%EF%BC%9A%E5%90%88%E7%90%86%E7%AE%A1%E7%90%86%20Netty%20%E5%A0%86%E5%A4%96%E5%86%85%E5%AD%98.md

https://learn.lianglianglee.com/%E4%B8%93%E6%A0%8F/Netty%20%E6%A0%B8%E5%BF%83%E5%8E%9F%E7%90%86%E5%89%96%E6%9E%90%E4%B8%8E%20RPC%20%E5%AE%9E%E8%B7%B5-%E5%AE%8C/11%20%20%E5%8F%A6%E8%B5%B7%E7%82%89%E7%81%B6%EF%BC%9ANetty%20%E6%95%B0%E6%8D%AE%E4%BC%A0%E8%BE%93%E8%BD%BD%E4%BD%93%20ByteBuf%20%E8%AF%A6%E8%A7%A3.md

NielsPilgaard commented 2 years ago

Nice researching!!

Could someone please verify that adding the JVM argument -Dio.netty.maxDirectMemory=0 fixes the issue? I have yet to run into it myself, so I can't do much there 😅

XenonDB commented 2 years ago

Nice researching!!

Could someone please verify that adding the JVM argument -Dio.netty.maxDirectMemory=0 fixes the issue? I have yet to run into it myself, so I can't do much there 😅

It seems work. I launched E6E using Java 8 with this argument and played for 4 hours, and the memory usage of JVM is kept at about 8GB (I allocate 6GB for heap memory)

Tueneap commented 2 years ago

Sadly adding that argument did not fix it for me. It still crashes every 2 hours. The weird thing is that before reinstalling Win 10, I could play for 4-6 hours sometimes and rarely for just 2 hours. Since then I have even downloaded the Adoptium java that the official Enigmatica site suggested, but it didn't change anything. I can't afford to remove Optifine however. A bit more info: I am playing on my friend's server, tried allocating 5, 8, 10 GB of memory out of my 16 total.

johnnylingster commented 1 year ago

I would try. You have to download the jdk file and install on your pc. We switched to multimc and told it to use jdk 16. Works just fine.

On Fri, Apr 15, 2022, 6:55 PM ALainxD @.***> wrote:

Like 50% of the people playing on my server get out of memory after a few hours

— Reply to this email directly, view it on GitHub https://github.com/EnigmaticaModpacks/Enigmatica6/issues/4469#issuecomment-1100455163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLUWGAXIJZSU24VEPNJRTLVFHXU7ANCNFSM5RKIP2IQ . You are receiving this because you commented.Message ID: @.***>

johnnylingster commented 1 year ago

It has for us. 3 folks playing and no memory leakage for the last week.

On Fri, Apr 15, 2022, 6:23 PM ALainxD @.***> wrote:

So useing Java 16 should completely solve the issue?

— Reply to this email directly, view it on GitHub https://github.com/EnigmaticaModpacks/Enigmatica6/issues/4469#issuecomment-1100441853, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLUWGCXPEQLZ6SMY3EZGX3VFHT6ZANCNFSM5RKIP2IQ . You are receiving this because you commented.Message ID: @.***>

Old-Man-D commented 1 year ago

Java 16 completely fixed the issue for me.

Kanzaji commented 1 year ago

Java 16/17 seems to be fixing this issue for everyone. The argument works only for some people for some unknown reason.

Gredys commented 1 year ago

Java 16/17 seems to be fixing this issue for everyone. The argument works only for some people for some unknown reason.

Just tested with Java 17 and such arguments (including mentioned one): -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dio.netty.maxDirectMemory=0

After 4 hours AFK memory increased only by 700Mb (before it was like 2-5Gb)

P.S. Multiplayer