TeamGalacticraft / Galacticraft-Legacy

An advanced Space Dimension Mod for Minecraft
MIT License
75 stars 33 forks source link

[Bug]: Leaking fluid pipes #129

Closed adamsong closed 1 year ago

adamsong commented 1 year ago

Forge Version

14.23.5.2860

Galacticraft Version

4.0.2.284

Log or Crash Report

image image image image

Reproduction steps

TickHandlerServer.fluidNetworks has 1640136 instances of FluidNetwork most of which only reference one TileEntityFluidPipe, with hundreds of thousands of tile entities with the same position. Ticking all of these causes massive amounts of server lag, solved by a restart.

My working theory is that unloading the chunk is supposed to delete the tile entity, but it doesn't get GC'd due to the reference from TickHandlerServer.fluidNetworks then the chunk gets loaded and creates a new tile entity, which makes a new network, which gets saved to the list. Its also possible that when the network is ticked, it loads the chunk, making the issue worse.

ROMVoid95 commented 1 year ago

Can you iterate what you mean by leaking pipe please. Is this happening on every pipe system in your world? What are the coords in reference too in the attached screenshot? (if they are coords). I didn't write the network code and have tried to not touch as much of it as possible as its a sheer mind-f^&k to go through, and this issue is the first i've heard of seen of this. Also re-produce this on the most current version please to continue any further.

adamsong commented 1 year ago

Can you iterate what you mean by leaking pipe please.

Memory leak, tile entities that minecraft has removed are being prevented from being cleared by hard references in galacticraft code

What are the coords in reference too in the attached screenshot? (if they are coords).

Coords are locations in which fluid pipe tile entities exist, the count is the number of tile entities with those coords.

and this issue is the first i've heard of seen of this

Likely the same bug as micdoodle8/Galacticraft#3448. This issue most likely will only affect players who don't restart every 24 or so hours, and have pipes they load and then unload, making it not noticeable, but almost certainly present.

Also re-produce this on the most current version please to continue any further.

The relevant line of code has not been touched in 6 years.

github-actions[bot] commented 1 year ago

Issue has been marked stale because it has been open 7 days with no activity. Issue will be closed in 24 hours if not updated

adamsong commented 1 year ago

Bug still exists, not stale

ROMVoid95 commented 1 year ago

@adamsong do you still have the world this happened in?

adamsong commented 1 year ago

I broke all the pipes that were causing issues