BuildCraft|Core

BuildCraft|Core

7M Downloads

Pipes in unloaded chunks causing high CPU usage

zmaile opened this issue · 7 comments

commented

In this case, I have a long length of pipe that extends past the currently loaded chunks (to an oil well). If i stand halfway along the pipe length (so my base and all pipes are in loaded chunks), i have constant 10-12ms/tick (sustained for minutes). If i am to either end of the pipe run (either at the oil pump end or the base) then the ticks become much longer, up to 1000ms/tick. A JvisualVM screenshot is attached.

This issue occurs with both item and fluid pipes (kinesis pipes are untested).

Relevant software versions:
Java: openjdk version "1.8.0_111"
Forge: forge-1.8.9-11.15.1.1890-1.8.9-universal.jar
SpongeForge: spongeforge-1.8.9-1890-4.2.0-BETA-1762.jar
Buildcraft: buildcraft-7.2.7.jar

Normal CPU usage (when standing halfway so all chunks are loaded, 11ms/tick)
profile-normal

High CPU usage (when standing at one end, getting 90ms/tick)
profile-high cpu

commented

looks like ghost loading to me, if the an item goes from 1 pipe to the next but the next is in a non loaded chunk, that chunk get's loaded (and the pipe needs to read it's nbt, initialize itself, ...) as that chunk is not suposed to be loaded it's instantly (or the next tick) unloaded, the pipe needs to write all that data to nbt to be saved again

does this heapen as well (or less/worse) without sponge? i know they edit alot of vanilla behaviour and might have an impact

commented

Could you send us the complete snapshot files, if possible?

Also, yes, I'd like to see a test without Sponge, preferably also with
snapshot files for both cases. Thanks in advance!

2016-11-23 11:22 GMT+01:00 AEnterprise [email protected]:

looks like ghost loading to me, if the an item goes from 1 pipe to the
next but the next is in a non loaded chunk, that chunk get's loaded (and
the pipe needs to read it's nbt, initialize itself, ...) as that chunk is
not suposed to be loaded it's instantly (or the next tick) unloaded, the
pipe needs to write all that data to nbt to be saved again

does this heapen as well (or less/worse) without sponge? i know they edit
alot of vanilla behaviour and might have an impact


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#3458 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAG7anhVnxwVWb1xAnJYr1VqUIKZivZtks5rBBPcgaJpZM4K6Pm6
.

commented

With SpongeForge disabled, the issue doesn't exist. Below link contains 4 profiling snapshots (with+without SpongeForge, and at middle+end of pipe run)

20161123 Buildcraft profiling snapshots.zip

EDIT: I also tried with SpongeForge, but all SpongeForge mods disabled, and the issue reappeared. So it seems related to sponge itself.

commented

alright, i would sugest reporting this to forge, i don't know the exact code from BC and forge involved so i might be wrong

but from behaviour and experience it seems like sponge is not only loading the chunk but it probably only realises it needs to unload it a tick later, so the chunk ticks, everything moves, unloads and repeat each time something crosses into the new chunks

does this also occur when it's an empty pipeline (no fluids/items passing through it all), best tested with items as with fluids can bounce back when it doesn't fit or has loops

commented

Yeah, both item and fluid pipe even when empty were causing high CPU usage.
I'll put this issues up on sponge now.

commented

nothing should be going on then, the pipes would not be querrying blocks next to it to verify if they need to connect, that could cause the chunk to be loaded but i don't see why that would keep heapening, once they all did that the chunks would be loaded while the shouldn't be and get unloaded, somehow the pipes get trigered to constantly check

commented

So it seems to be a issue with sponge's chunk GC implementation. For reference, a workaround is available by disabling the chunk GC in sponge by setting the following in sponge's global.conf:

chunk-gc-tick-interval=0

Thanks for your help guys.