Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

Memory leak with configuration objects

Open MagMaad opened this issue 9 months ago • 1 comments

Type of bug

Performance issue or memory leak

/ess dump all output

https://essentialsx.net/dump.html?bytebin=x56mjgy9jM

Error log (if applicable)

No response

Bug description

Essentials seems to be leaking configuration objects. Not much else to be said.

Steps to reproduce

  1. Start server
  2. Wait ~2 hours (depending on traffic)
  3. Performance issues will start to arise

Expected behaviour

Objects should be properly cleared

Actual behaviour

Object references are retained somewhere, hence the memory leak is present

Additional Information

Please leave a comment if you require the actual heapdump file, and I'll find a way to upload it...

Image

MagMaad avatar Apr 01 '25 13:04 MagMaad

same here............

Koora7334 avatar Apr 03 '25 17:04 Koora7334

Hey guys!

I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using!

https://github.com/EssentialsX/Essentials/actions/runs/16403915568#artifacts

JRoy avatar Jul 20 '25 20:07 JRoy

Hey guys!

I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using!

https://github.com/EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

R00tB33rMan avatar Jul 24 '25 21:07 R00tB33rMan

Hey guys!

I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using!

https://github.com/EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

could you send over a /ess dump all

JRoy avatar Jul 24 '25 21:07 JRoy

Hey guys! I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using! https://github.com/EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

could you send over a /ess dump all

Here you are. Thank you for the incredibly fast response: https://essentialsx.net/dump.html?bytebin=laSTRIiKBr

(I don't suspect this is caused by my Folia EssentialsX fork by any means)

R00tB33rMan avatar Jul 24 '25 21:07 R00tB33rMan

Hey guys! I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using! EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

could you send over a /ess dump all

Here you are. Thank you for the incredibly fast response: essentialsx.net/dump.html?bytebin=laSTRIiKBr

(I don't suspect this is caused by my Folia EssentialsX fork by any means)

I do not see how the code in my branch would cause player's data to swap. Maybe disappear or not save correctly, but it should not be swapping player data. I would be interested on results from this branch on non-folia servers.

JRoy avatar Jul 26 '25 04:07 JRoy

Hey guys! I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using! EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

could you send over a /ess dump all

Here you are. Thank you for the incredibly fast response: essentialsx.net/dump.html?bytebin=laSTRIiKBr (I don't suspect this is caused by my Folia EssentialsX fork by any means)

I do not see how the code in my branch would cause player's data to swap. Maybe disappear or not save correctly, but it should not be swapping player data. I would be interested on results from this branch on non-folia servers.

We had over ~830 tickets about data loss and discovered it in fact was not swapping and was just data loss, to a severe degree. We knew the risks of running this JAR and ran it under the assumption we’d get some good results for you. Hopefully a solution can be implemented; though, it’s highly unlikely Folia is the cause. We reverted the commit and all of these issues have since vanished, meaning we can directly attribute this fix towards this issue. I appreciate your help in trying to resolve this and am happy to experiment further!

R00tB33rMan avatar Jul 26 '25 08:07 R00tB33rMan

Yeah, this branch cause dataloss, same for me

Koora7334 avatar Jul 29 '25 07:07 Koora7334

Hey guys! I have a test branch that may resolve some of the memory leak issues you were having, below you'll find a link to where you can download an archive of jars, extract whichever you need for your servers. Make sure to take a backup of your server before using! EssentialsX/Essentials/actions/runs/16403915568#artifacts

Hey! I gave this a spin (and of course made backups) and am noticing random instances of balance swapping, particularly. I suspect users' data is somehow colliding in some way since this change? It's pretty unusual and not consistently reproducible.

could you send over a /ess dump all

Here you are. Thank you for the incredibly fast response: essentialsx.net/dump.html?bytebin=laSTRIiKBr (I don't suspect this is caused by my Folia EssentialsX fork by any means)

I do not see how the code in my branch would cause player's data to swap. Maybe disappear or not save correctly, but it should not be swapping player data. I would be interested on results from this branch on non-folia servers.

Any other recommendations and such?

R00tB33rMan avatar Jul 31 '25 04:07 R00tB33rMan

@R00tB33rMan @Koora7334 Try this new build https://github.com/EssentialsX/Essentials/actions/runs/16857562253/artifacts/3727903291

JRoy avatar Aug 10 '25 05:08 JRoy

@R00tB33rMan @Koora7334 Try this new build https://github.com/EssentialsX/Essentials/actions/runs/16857562253/artifacts/3727903291

Hey @JRoy, deployed this JAR late last night. Haven't received any reports from players regarding data loss this time around and I would (assume) this is accurately targeting the initial report. I'll let you know if I encounter any issues!

R00tB33rMan avatar Aug 11 '25 18:08 R00tB33rMan

@R00tB33rMan @Koora7334 Try this new build https://github.com/EssentialsX/Essentials/actions/runs/16857562253/artifacts/3727903291

Hey @JRoy, deployed this JAR late last night. Haven't received any reports from players regarding data loss this time around and I would (assume) this is accurately targeting the initial report. I'll let you know if I encounter any issues!

great! hows the memory usage?

JRoy avatar Aug 11 '25 18:08 JRoy

@R00tB33rMan @Koora7334 Try this new build https://github.com/EssentialsX/Essentials/actions/runs/16857562253/artifacts/3727903291

Hey @JRoy, deployed this JAR late last night. Haven't received any reports from players regarding data loss this time around and I would (assume) this is accurately targeting the initial report. I'll let you know if I encounter any issues!

great! hows the memory usage?

It appears better and more stable. I suppose @MagMaad will need to experiment with this JAR, since he’s the one that receives the biggest influx of joins but so far, so good!

R00tB33rMan avatar Aug 11 '25 19:08 R00tB33rMan

Yup, seems good for me, memory is stable

Koora7334 avatar Aug 11 '25 19:08 Koora7334

That's great to hear! I've opened a PR with my changes: #6266

You can follow that PR to get a notification when the change is released to dev builds!

JRoy avatar Aug 11 '25 20:08 JRoy