Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped Item entities gradually increase if showoff item is enabled #37

Open
Sylensky opened this issue Mar 19, 2020 · 18 comments
Open
Labels
help wanted Extra attention is needed

Comments

@Sylensky
Copy link

Hi,

i noticed throughout the time that the paper autoremoval function wants to remove the hovering chest items but it doesn't let it so the dropped item counter increases and if it reaches a massive amount it is noticeable for players and the timings itself.
I don't really have a logfile since i can't track it down with the logs but i could say the reproduction steps for this issue can be:

  • make a lot of chest shops
  • fill them with the items
  • wait for couple hours and keep track of the timings

any thoughts on this one?
Kind regards,
Sylensky

@RoboMWM
Copy link
Member

RoboMWM commented Mar 20, 2020

i noticed throughout the time that the paper autoremoval function wants to remove the hovering chest items

Um, the lifetime of these entities are set to the maximum amount of time so they should never be cleaned up by Paper.

but it doesn't let it so the dropped item counter increases

what dropped item counter??

reaches a massive amount it is noticeable for players and the timings itself

Not true. Dropped items are the least expensive entity, and even more so with inactive ticking.

Please paste a link of /timings paste with sufficient time (e.g. an hour) as well as evidence (screenshot or something that can enumerate dropped items)

@Sylensky
Copy link
Author

Sylensky commented Mar 23, 2020

Sorry for my late reply. I am trying to reproduce it but it didn't occure since now.

Um, the lifetime of these entities are set to the maximum amount of time so they should never be cleaned up by Paper.

Yes that is what i have seen.

what dropped item counter??

i meant the tab of the timings where u can view what entities are in each world. Especially one world and around one location it was like 100k+ dropped items where i didn't found any dropped items.

Apparently i managed to get some results. I was testing another tool than the inbuild timings to get more accurate results. These below may help.
https://sparkprofiler.github.io/#FhsWleDXVF
https://timings.aikar.co/?id=e6ef52d491d1435d90ecd488a440d66a

@RoboMWM
Copy link
Member

RoboMWM commented Mar 24, 2020

Your links were messed up; I just fixed them. Just paste them in next time.

@RoboMWM
Copy link
Member

RoboMWM commented Mar 24, 2020

I guess you have a lot of chests being opened and closed? Not really sure, will need to take a closer look but it just seems it's often being asked to update the items above the shop, which only happens when players interact with a chest.

@RoboMWM
Copy link
Member

RoboMWM commented Mar 24, 2020

Hmm, actually it could be the thing that checks for shops on chunk load. I guess there are a lot of places around your world that consist of "shop blocks" (blocks that can be used as shops in the config) so it's checking to see if any of those blocks in that chunk is a shop. Are there any particular places or areas that contain a lot of chests (or shop-related blocks)?

@Sylensky
Copy link
Author

Are there any particular places or areas that contain a lot of chests (or shop-related blocks)?

Indeed there are a lot of shop blocks around the area i mentioned. There is a an user area where they can build their shops. i would guess couple houndreds of shop blocks are in there.

I guess you have a lot of chests being opened and closed? Not really sure, will need to take a closer look but it just seems it's often being asked to update the items above the shop, which only happens when players interact with a chest.

There was not more than one player refilling his chests. Does autorefilling with minecarts and hoppers count as well?

@RoboMWM
Copy link
Member

RoboMWM commented Mar 24, 2020

Does autorefilling with minecarts and hoppers count as well?

Idk if those trigger InventoryOpenEvent, which iirc that's what I'm watching. But if those minecarts/hoppers are constantly causing chunk loads that's an issue too.

@RoboMWM
Copy link
Member

RoboMWM commented Mar 24, 2020

The easy solution (and preferred if this is what's happening anyways) is to keep those chunks loaded if they're often being loaded and unloaded.

I'll try to de-anonymize those classes so it's easier to tell which task is being expensive in timings

@Sylensky
Copy link
Author

Idk if those trigger InventoryOpenEvent, which iirc that's what I'm watching. But if those minecarts/hoppers are constantly causing chunk loads that's an issue too.

If the minecarts and hoppers would cause chunk loads it would have been noticeable in the timings. But the loaded chunks are staying constant throughout that lagg spike.

@RoboMWM
Copy link
Member

RoboMWM commented Mar 25, 2020

I don't see any lag spikes in your timings... and the only time I'd see lag spikes would be shortly after a chunk load.

@RoboMWM
Copy link
Member

RoboMWM commented Mar 25, 2020

The task is scheduled to run after a chunk load, so it isn't going to show up in timings because the logic is not running during the chunk load. I believe if you drill down in the timings under that task you can see that the handler for chunk load is the first item that appears, iirc.

@Sylensky
Copy link
Author

i will try to keep those chunks loaded and make a similiar timing.

nevertheless before i do that i just noticed the current one. Just to confirm it comes from chunk loading and the showoffitems of the shops i captured this timing below.
https://timings.aikar.co/?id=533e90935b2545f89c5cf1eb96fc52d3#timings

My spark capture was apparently to late because i just joined and noticed it.

@Sylensky
Copy link
Author

So i did follow your suggestion to keep these chunks loaded but it doesn't seem to help resolving that issue. I kept the server running for almost 5 days now and the spikes are even getting bigger. Strangely spark isn't able to collect data somehow but the timings are logging something.
It has for sure something to do with entities as the timings say but sadly no exact details on that.
https://timings.aikar.co/?id=598d6cb2418d481ca3c5ba001ccba1ec

Do you think it is another problem?

@Sylensky
Copy link
Author

Disabling the item showoff option in the config is a valid workaround to reduce the issue.

@RoboMWM RoboMWM changed the title Item entities count up Dropped Item entities gradually increase if showoff item is enabled Apr 17, 2020
@RoboMWM RoboMWM reopened this Apr 17, 2020
@RoboMWM
Copy link
Member

RoboMWM commented Apr 17, 2020

I'd still like to address this. I haven't been able to do any testing myself because my server's currently broken (and I can't find the plugin that's causing logins to be denied atm). I'm going to add debugging to this, just haven't had time to look at it quite yet.

@RoboMWM RoboMWM added the help wanted Extra attention is needed label Apr 17, 2020
@EmpathyHeals

This comment has been minimized.

@RoboMWM
Copy link
Member

RoboMWM commented Apr 24, 2021

idk if debugging is in here for this, but go ahead and enable it. When it happens paste the log here via gist.

@RoboMWM

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants