Enigmatica 6 - E6 - 1.16.5

Enigmatica 6 - E6 - 1.16.5

1M Downloads

Repeatable out of memory condition

Old-Man-D opened this issue Β· 68 comments

commented

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

commented

edit: p.s. i googled journeymap with this error. i try to do a run with chunk-caching off. Seemed a problem earlier. Maybe the author couldn't fix it completely.

I was able to fix it completely after much research and rewriting the logic. I am glad to hear that you have ruled out JM. If you need anything from me to help you find the issue, please feel free to reach out.

Spark is okayish for finding memory issues, it is better and more user friendly for finding other slowdowns. I usually use VisualVM so you can see the heap in real time as the memory use increases. It is fairly simple and free to download and setup, just attach it to your minecraft instance and do memory profiling.

commented

Hi again.
so in the meantime i tried to add optifine if there are some differences. I can say: nope no differences.

A side note: the server is stable no sign of any issue on that part. That and the nullpointer issues of chisel lead me believe there is maybe a graphical issue(thats why i tried optifine). But just a guess.

And spark seems no help because it looks like there’s more likely an event that fills the memory in short time than a steady slow growth. And when the memory is flooded the network-part of java is broken as well. So no chance to run spark after the event.

I will try this visualvm if its running with clients as well.
Maybe there is more to find
so ’til next time

commented

I've been running into this as well. Playing on a localhost server, consistently get booted after about 2 hours due to OOM. Similar story in singleplayer, except instead the game just lags until it's unplayable. 8 GB assigned, latest pack version (1.1.2).

Made a head dump using VisualVM, in case it's helpful whatsoever:
https://drive.google.com/file/d/1PWPXYPWUL4htGm47RSRYhqhuAqXJRAmm/view?usp=sharing

Google Docs
commented

Thanks for the report.

A crash report would be helpful here :)

commented

It's not producing a crash report. What it is doing is closing the connection to the server with the message that it was out of memory. This does not crash the client, it just brings you back to the main menu. But if you try and reconnect to the server, it errors out. I have had to restart the client to be able to reconnect to the server. The next time it happens, I will get screenshots of the specific messages. I am also going to disable optifine again and see if I can get more information that way too.

commented

Ah okay, thanks for clearing that up. Please try adding these Java Arguments and see if they help:
https://wiki.enigmatica.net/main/help-desk/guides/performance-tweaks#jvm-arguments

You can add them in the Minecraft settings in the CurseForge App

commented

yeah, those are the jvm arguments I have.

commented

Does it work when you don't use shaders nor Optifine? Both of those, especially Optifine, are known to cause problems and crashes with this modpack

commented

I am going to do more testing without optifine. However, it seems as though other people in the discord have similar problems without optifine. like there is a memory leak in a mod. My suspicion is Ars Nouveau based simply on other issue recorded here.

commented

I can confirm that the server myself and 3 friends are on have the same issue. kicks us out of the server after so long. I start at 7 gig for Enigmatica for memory, when it gets to 10 and a half, it kicks us.

commented

this is a screenshot of a log from our server if it'll help.
Screenshot_20220322-183320

commented

Our experience is similar. We would play for a little over an hour before the client would leave the world unexpectedly, show a Saving World message, and then either the screen Old-Man-D posted or this one:
Out of memory error 3-22-2022

In either case, it was the client closing down the world as our server continued. When one of us errored the others kept playing.

johnnylingster and I both ran a brand new single player world for hours with no issue. His ran overnight and I actively played, so it suggests it might be something in our multiplayer world that didn't like the update. We came from modpack version 0.5.25.

commented

Ok, I just had the crash again, this time without any optifine.
Screenshot 2022-03-23 021718

What it did was cause the client to completely close, however it did not produce a crash report. (actually, maybe I hit "quit game", I can't quite remember).
latest.log

commented

Here is the server console:

Screenshot 2022-03-23 022755

commented

With me and my wife it is the same. Running on a dedicated server. No extra mods.
It's occuring both on a old World from 0.5.25 to 1.0 and a new from 1.0.The server itself is stable. But the clients run out of memory and need a restart to work properly again. Different jvm arguements and different Java/Adoptium versions. Same effects.
In the log ar different unspecific null-pointer errors without to see from where.
"[main/ERROR]: java.lang.NullPointerException"

commented

In case it is relevant, our server and my instances of E6E are both on 1.0.0 and were started on this version, they were not upgraded from earlier versions.

commented

loaded without starlight-mod still same error on my side. :(
after about 2-2.5 hours in game

attached a shortened log
Fehler.txt

edit:
next crash after 2 hours
next log-snippet with a more detailed out of memory error
log2.txt

edit edit: last line in the snippet may be the re-enabling of the resourcepack

commented

Hmm.. Could you please try removing the mod Starlight and see if the issue persists?

commented

sure. is that a client side mod? or would I have to get the server owner to also remove it?

commented

sure. is that a client side mod? or would I have to get the server owner to also remove it?

It needs to be removed on both server and client.

commented

Hi again.
the 2 runs from my earlier posts are: first clientside only off and second run both sides without starlight
so no or just a marginal impact on this error from this mod :(

commented

I wonder if frequent loading of all advancements has anything to do with this, Loaded 9816 advancements is in the log a few times there.

commented

Hi again.
topic advancements: this message comes up as a part of the FTB Utilities Backup on the server side. It has hiccups with my advancements only, but not with the ones of my wife. but she has this memory problem too.
so i cant say if its connected with the memory error.

side note: the nullpointer errors seem to come up pretty independently of the backups, they can start from 1hour to 20 minutes before a crash occures.

edit: i had a look in the logs of my wife.. nothing suspicious in her log. no error no exception.
just cache cleared, world id and uuid reseted and the discord mod closing down and end.
edit edit: looked through some more logs at her computer. the last was just an excetpion. random nullpointer errors and the achievement synching in her logs. but only my achievements get noticed in the server-logs

commented

Removing starlight didn’t change anything on my end. Also, this time when it kicked me out, I made sure to stay on the main menu and try and reload the server. It just says connecting, and never actually connects. I let it sit that way for like 10 minutes before giving up and restarting the client.

commented

I checked our version, and we only go to 1.0. Is there somewhere we need to go to find 1.1?

commented

Could you please update to 1.1.0 and try again?

commented

Just the usual place, CurseForge.

commented

You may need to set preferred release to alpha to see them in the curseforge alpha.

commented

I found it. the server is the one we need to use the FTP option to upgrade to 1.1 g-portal is our server provider and they have to do the update themselves apparently?

commented

I will have to wait for my server to also update, as I am not the admin of said server. But I will pass this along to them.

commented

Hi again.
Had a chance to update in the morning. But no improvement. I have to have a look in the logs after work. But there was definitely again this error.

commented

I've ran into a memory leak in Singleplayer E6E as well. My recommendation is, if it is indeed a memory leak to go back to the main menu and then make a heapdump via external tools, I've used the CLI tools jmap to do so:
(All commandline, make sure these tools are in your path, should be found in the same folder as your java binary)
First run jps to find the Process ID of Minecraft
Then jmap -dump:format=b,file=heapdump.bin <PID goes here>
Note that these will be several gigabytes (your heap size plus some), so don't bother with this unless you can analyze them yourself(I recommend Eclipse MAT) or upload them somewhere. I'm happy to analyze heapdumps you upload.

commented

Hi again.
tried the Heapdump-thingy. No helpful infos on first glance. (and not versed enough for deeper inspection). Uploading is not an option, 5gigs(minimum) upload would take away my internet for a full day.
The Error is qiet consistently in time without change if the memory is 5, 7 or 10 gigs allocated.
Java or Adoptium versions dont matter, tried different.

Updated to 1.1.1 the error still persists.

The error in the normal log:

A few Nullpointer Errors of Chisel, but Chisel is not the suspect. Made a run without it and it occured nonetheless.
A few Tetra-Tools are logged to be inspected. Looks unsuspicious but i dont know.
and finally

[31Mar2022 14:02:06.649] [main/FATAL] [net.minecraft.client.Minecraft/]: Out of memory io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 3020 byte(s) of direct memory (used: 10737417708, max: 10737418240) 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.network.PacketThreadUtil$$Lambda$38572/1895663636.run(Unknown Source) ~[?:?] 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) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) [forge-1.16.5-36.2.29.jar:36.2] at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$506/1429306467.call(Unknown Source) [forge-1.16.5-36.2.29.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:?]

in the debug log (curseforge option) shortly after overflow:
[31Mar2022 14:01:53.872] [main/DEBUG] [net.minecraftforge.registries.ObjectHolderRef/]: Unable to lookup atum:jeweled_fish for public static net.minecraft.item.Item com.teammetallurgy.atum.init.AtumItems.JEWELED_FISH. This means the object wasn't registered. It's likely just mod options.
of a few dozen Items

i hope it's helpful.
sincerly

commented

There's /spark heapsummary, post the results of that here when a bunch of memory has been leaked.
Ideally post two, one right after starting the game, and one after a bunch of memory has been leaked, standing in roughly the same position.
Roughly how long does the game run before you run out of memory(Please specify how much memory you're giving it as well)

commented

Hi again,
Java 1.8.0 51 Built-in(cursforge version-choice is bugged)
10GB allocated
Spark:
fresh after login and a homeport: https://spark.lucko.me/AoJo9V3euM
after 1. hour same spot after some exploring: https://spark.lucko.me/gkKd3KM2Xj
after 90 min same spot after some inventory sorting https://spark.lucko.me/Dhg30KwHQB
after relativ exact 2 hours no spark but a full crash.. a new one xD had the F3 screen on to have look on the memory(normal GC between 70-80%) and wanted to do the summary but a crash came earlier.
crash-2022-04-01_15.07.51-client.txt

P.S. wife had a error about an hour in with 7gigs allocated in creative mode to build. In normal gameplay it takes about 2 hours before it crashes

spark is a performance profiler for Minecraft clients, servers and proxies.
spark is a performance profiler for Minecraft clients, servers and proxies.
spark is a performance profiler for Minecraft clients, servers and proxies.
commented

Heh, unrelated crash πŸ˜„ I reported it.

commented

I still haven't found any smoking gun in any of the logs :<

I asked about the Journeymap log on their Discord though: https://discord.com/channels/239040424214396929/325390896524951553/959676538431868928
Edit: It's not Journeymap causing this ._.

Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
commented

Hi again
next run: Modpack ver 1.1.2; Java 1.8.0 51; 10GB allocated
Sparkc after login Homeport: https://spark.lucko.me/L9XjR2R6zz
first hour same spot: https://spark.lucko.me/op2u63Krlo
90 mins same spot: https://spark.lucko.me/JOeTZdc7mL
minute 100 afking for the last 10 mins and error came. Reconnecting is not possible. Client stays in status connecting to server. but no info on the server-side. even the server-pinging is broken.

log between spark an shutdown:
[02Apr2022 04:12:34.290] [main/INFO] [journeymap/]: TileDrawStep.updateRegionTexture hit max count, 1000000 [02Apr2022 04:13:03.319] [main/INFO] [journeymap/]: TileDrawStep.draw(low) hit max count, 1000000

same Memory Error as 2 Posts prior

tried to start a singleplayer world. but it locked up at 100% in the preperation. tips are cycling through but no reaction. canceled after 5 mins without change in the logs.

My wifes Pack is dying in an hour. at the moment heavy building in creative mode.

edit: p.s. i googled journeymap with this error. i try to do a run with chunk-caching off. Seemed a problem earlier. Maybe the author couldn't fix it completely.

spark is a performance profiler for Minecraft clients, servers and proxies.
commented

Heap dump immediately after OOM kick... almost 7GB analyzed with MAT and nothing looks too crazy but there is 1.6GB in unreachable objects so no clue... hopefully someone smarter can look at it
https://drive.google.com/drive/folders/1_rFY7gwFA5ju-3Cd8lUbaX0vGR2ZRHff?usp=sharing

commented

Hi again.
Journeymap-caching isn't it either. Wife is still out in an hour :(
edit made a run without Journeymap and jmi. they're no suspects anymore. :s and the search goes on :(

commented

I ran into the same problem when I first installed the 1.0.0 release on ATLauncher - like the above user, almost exactly at the 2 hour mark. When I switched it over to an instance on MultiMC, it went away, and I played for a couple of weeks without seeing it. Then two days ago, I installed the 1.1.2 update, on MultiMC this time, and the problem was back.

Poking and prodding at it for a couple of hours (would have been less, but dat load time) and I nailed down what was difference.

The Important bit: Is anyone seeing these OOM errors on Java 16? The new 1.1.2 instance set itself up to use Temurin Java 8. I switched it to Oracle Java 16, and I played for 5 hours with no OOM.

commented

I ran into the same problem when I first installed the 1.0.0 release on ATLauncher - like the above user, almost exactly at the 2 hour mark. When I switched it over to an instance on MultiMC, it went away, and I played for a couple of weeks without seeing it. Then two days ago, I installed the 1.1.2 update, on MultiMC this time, and the problem was back.

Poking and prodding at it for a couple of hours (would have been less, but dat load time) and I nailed down what was difference.

The Important bit: Is anyone seeing these OOM errors on Java 16? The new 1.1.2 instance set itself up to use Temurin Java 8. I switched it to Oracle Java 16, and I played for 5 hours with no OOM.

Holy crap I think you've found the smoking gun (for me at least). Forced my instance to use Java 16 and it's been running smooth for 5+ hours now.

commented

I will try java 16. is there any changes to the jvm arguments that I need?

commented

I will try java 16. is there any changes to the jvm arguments that I need?

Probably a few to optimize the experience, but I haven't done any yet

commented

Any way we can get the bundled java version changed at the pack level? My gf and I have ran into this 4 times today combined.

commented

Hi again.
MultiMC and Java16 are looking like a valid workaround. A solution with the curseforge launcher would nice. Or even better finding the primary source of this problem. But beggars can't be choosers xD

Thanks for this possibility =D

commented

I ran with java 16 through the GD launcher. My session still ended in a crash, but I do not think it was this issue. On a side note, I had been recommended to use ZGC in the discord support channel. Using this GC I had significant lag spikes every couple of seconds as GC ran. In game it would vary between about 90% up to 100%. Using G1GC it did not have this, it would vary between about 40% up to 75%, at which point GC would fire off. This is with 8G allocated. If java 16 is the correct solution, and if we are supposed to use ZGC, are we supposed to allocate more, to give ZGC more overhead to work with?

commented

Yes. The newer java gc like zgc and shenandoa handle larger amounts of ram better but seem to be quite a bit worse if you are near the limits of your PC and can't increase the amount of ram you are using.

commented

I can confirm that using JDK 16.0.2 and MultiMC works without issue. No memory leak failure! My friends using a server tried this and I had no issues after 4 hours. I myself also gave it 10 gig ram to use as I did even with the memory leak.

commented

Any way we can get the bundled java version changed at the pack level? My gf and I have ran into this 4 times today combined.

Pretty sure that's determined by your launcher, not the pack.

commented

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

commented

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.

commented

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

commented

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

commented

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

commented

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 πŸ˜…

commented

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.

commented
commented

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

commented

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

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.
commented

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

commented

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)

commented

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.

commented
commented
commented

Java 16 completely fixed the issue for me.

commented

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

commented

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