PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
53 stars 21 forks source link

Possible Memory Leak due to Furnitures (Too many ConcurrentLinkedQueue nodes) #3779

Closed WhitehatD closed 6 days ago

WhitehatD commented 3 months ago

Terms

Discord tag (optional)

whitehatd

What happened?

This issue is related to the API. There is a memory leak that's been ongoing on our server for quite a while. This issue is related to furnitures, they are being placed in multiple worlds and there's a lot of them. I initially noticed that they wouldn't spawn properly in unloaded chunks, and I created a method that caches them to their respective chunk, where they need to be placed, and re-tries placing them on ChunkLoad.

Now the actual problem: after a while, the server simply crashes because it's out of memory. Visually, there are a lot of glitched furnitures placed in the same spot when there should be just one.

image

I would greatly appreciate if we could talk more about this on discord.

Steps to reproduce the issue

I am not 100% sure how to reproduce it. I want to find out if this is something I'm doing wrong or if there's something wrong with ItemsAdder.

Server version

Current: git-Purpur-1985 (MC: 1.19.4)* Previous: git-Pufferfish-73 (MC: 1.19.4)

ItemsAdder Version

3.6.4-release-3

ProtocolLib Version

5.2.0

LoneLibs Version

1.0.54

Full server log

https://mclo.gs/EzyfReP

Error (optional)

There's no error.

Problematic items yml configuration file (optional)

No response

Other files, you can drag and drop them here to upload. (optional)

These are two heapdumps taken about 10 minutes apart from eachother. 1st: https://spark.lucko.me/PuoMwhj5XP 2nd: https://spark.lucko.me/4ZtauXgCmN

Screenshots/Videos (you can drag and drop files or paste links)

No response

LoneDev6 commented 3 months ago

Thank you for the detailed report, I will let you know as soon as possible

LoneDev6 commented 3 months ago

Sent you a message on Discord in a private ticket: https://discord.com/channels/533407895010803753/1257999854970343494/1258000123724824647

image