Powah! (Rearchitected)

Powah! (Rearchitected)

3M Downloads

Powah Crashes With Too Many Energy Cables [Issue Originally Marked As Solved, Definitely Not Solved]

SaltiestMeatBall opened this issue · 18 comments

commented

Version: (make sure you are on the latest version before reporting):

  • Minecraft: 1.19.2
  • Forge: 43.2.14
  • Powah: 4.0.11

Issue description:

When hooking together 50 or more Energy Cables precisely, server immediately falls behind by thousands of ticks before crashing 3-5 minutes later. Issue stops when you use less cables. This issue was posted back in late 2022 and closed for some reason, issue still remains and not solved by any Powah patching. If any was done.

Steps to reproduce:

Connect 50 or more energy cables of any quality together and then power them. Then, watch the console as your server tick rate rapidly deteriotates.

Is this a crash?, please include it here: (Recommended to use Gist)

This is a crash.

commented

Please provide a crash log and ideally a server profile (from Spark) as well.

commented

Have been experiencing this issue as well, the cause seems to be some kind of extreme memory leak, the thermo's especially suffered hard, with nearly 7GB of leaked memory occuring within just 30 mins.
But other tiles suffer the same issue, just not to the extreme extent that thermo's did.
Amongst these leaky tiles are the cables themselves, and as they get used a lot, they may not individually leak heavily, but their combined leakage is extreme.

If it is of any aid, I host a server that was on 1.20.1 previously (We downgraded due to how unstable 1.20 modpacks still tend to be) and did not suffer these memory issues there.
So either there is a change made to Powah in the 1.20 port that fixed the leak, or a change to Forge itself that did so.

I have multiple heap traces if you desire one, but these tend towards the 10+GB in size as a result of this memory leakage, so not sure how I would share any of them.

commented

I know of one such problem, but that was fixed in 1.19.2. A heap dump would be useful if you manage to upload it.

commented

(Or potentially you could open the heap dump and see what is happening)

commented

Wow that's crazy! Can you maybe look into what makes these ThermoTiles and CableTiles so fat? (Which fields)

If you can give me instructions on how, I would be more then happy to, I am not familiar with EMA, so I have no clue where to even start looking I am afraid.

commented

I believe I might have found what you wanted to know, though I am not certain as I stumbled across this bit just going around poking at things...
image

commented

Ah yes exactly, this indicates that the capabilities object is what is using all the RAM. Can you look at what is inside of it (and so on... ;))

commented

I have, and from what I can tell (As a complete java novice), this is prolly where the issue sits, given that it kinda seems like one massively oversized HashMap to have...
image

commented

(Or potentially you could open the heap dump and see what is happening)

I did open the heap dump, I used Eclipse Memory Analyser to process it, and it is what reported Powah's tiles as the issue, as even compressed the heap dump is still over 2GB I've been unable to get it uploaded, but here is a set of screenshots of the report made by EMA.
image
image
image

After I removed these two tiles from the world completely, The next dump reported the Solar panels and Energy Cells as most likely leak suspects.

Since removing all of these (Which accounted to about 200 blocks at most, most of them cables), memory usage has drastically decreased, and OutOfMemory no longer occurs. (Previously, it was guaranteed to occur after about 10 hours of up-time)

If there is any more detail or information I can provide, Please let me know, unfortunately transferring the heap file is just a nightmare due to even it's compressed size...

commented

Wow that's crazy! Can you maybe look into what makes these ThermoTiles and CableTiles so fat? (Which fields)

commented

Ahah, looks like a memory leak in the AECapFix mod. Updating it to the latest version should fix the leak. :)

I see, will try this and report on any success/failure!

commented

I am trying to get the heap uploaded so I can send it to you and hopefully make things easier for you to debug, but it is going incredibly slow unfortunately, so it will likely take at least an hour or two before this finishes.

commented

Ah, worst case you can also come on Discord for an interactive chat.

(You shouldn't expand the <class> as that is internal stuff shared by all instances of the same object.)

commented

Ah, I was not aware of that! Okay, having backtracked and expanded elsewhere, this is where the trail seems to be leading:
image
image
I unfortunately cannot expand any deeper because EMA shows 25 of the nearly 2 million entries, and I have no clue how you expand beyond that (Or if it is needed to look deeper?)

commented

Okay, looks like I was wrong and the upload ended early, yaay for unexpected success!
Here is the linky to the zip file: https://gameon.playat.ch/heap_dump_powah.zip

commented

Ahah, looks like a memory leak in the AECapFix mod. Updating it to the latest version should fix the leak. :)

commented

I am already happy to report that this has fixed the issue, put the thermo's back in, and not a single peep from spark when it comes to the symptoms I previously observed about the memory leakage!

Thanks a lot for all your work Technici4n, I wish I'd known it was such a easy fix before I needed to bother you about it.

commented

Ah that's great. Well I'm happy this is resolved. :)