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

[BUG] Memoty leak: entities not cleaned if you generate map with WorldBorder plugin without players #167

Open
gravit0 opened this issue Oct 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@gravit0
Copy link
Contributor

gravit0 commented Oct 21, 2024

Describe the bug
Map generation with WorldBorder causes memory leaks due to large number of entities and tile entities that are never cleared because the server does not tick when there are no players.

To Reproduce

  1. Install WorldBorder plugin
  2. Start map generation without players
  3. Generation stopped because memory is low

Expected behavior
It might be worth clearing entities in the absence of players elsewhere

Logs

Screenshots
Screenshot_20241022_053209

Additional context
Method updateEntities() in World executed only in tick()

Environment (please complete the following information):

  • Crucible Version: Last staging and rfb-support branch
  • Plugins: WorldBorder
  • Mods: None
  • Java Version: 21
  • OS: Linux
@gravit0 gravit0 added the bug Something isn't working label Oct 21, 2024
@EverNife
Copy link
Member

EverNife commented Nov 1, 2024

Well, now that you mention that, this is really a bug that i have faced like forever on Thermos/Crucible.

My main problem with this bug is related with items.
Sometimes like thousands of items are spawned on specific chunks and the amount just increase until a players come closer to the the chunk and them all of the items are removed at once.

I think this is indeed a serious problem, not only for when generating chunks, but for chunkloaders as well.

@EverNife EverNife self-assigned this Nov 1, 2024
@EverNife
Copy link
Member

EverNife commented Apr 7, 2025

Was taking a look on the system that manages this feature, its the "skip-entity-ticks" at the entities.yml file

And ca be disabled by changing it to false!

settings:
  skip-entity-ticks: false

Its a cauldron config that will handle conditions for entities to tick.

One of them, by default, is 'tickNoPlayers == false'

So, unless the chunk is forced, these entities will, by default, not tick when not near players.

The correct approach is to change the tickNoPlayers to true.
But i am not sure if its a worth approach when considering lag.

Gonna test on my server

@EverNife
Copy link
Member

EverNife commented Apr 7, 2025

On my server, the problem would be Items, as they would not despawn, the "Sushchestvo" as this is called, have a "inactiveTick" that is called! Some entities could override this (like items) to have an alternative aging, it would solve the items problem.

For normal entities a simillar approach could be done.

As i have disabled on my server, i am not sure if it's worth even creating the system, and i thinnk disabling the system is better for servers with chunkloaders.

Mainly because the major source of lag is usually caused by TileEntities, not entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants