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

World Edit causes MASSIVE memory leak in server. #2488

Open
4 of 5 tasks
dooblykid opened this issue Mar 15, 2024 · 1 comment
Open
4 of 5 tasks

World Edit causes MASSIVE memory leak in server. #2488

dooblykid opened this issue Mar 15, 2024 · 1 comment
Labels
status:pending Pending acceptance or closure. type:bug Incorrect behavior, not working as intended

Comments

@dooblykid
Copy link

dooblykid commented Mar 15, 2024

WorldEdit Version

7.2.15

Platform Version

Forge 47.2.20

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

World edit seems to inflate the heap for servers to sizes that pretty much cause the server to lag out. It took me forever to find out what mod was causing the tps to drop because I thought it was a mod that adds content and features. But somehow it's being caused by world edit. I extracted the Heap using spark and was able to get this information.
World edit is currently causing a memory leak that occupies 1.1 GB worth of Memory. Which makes my server unplayable when world edit is installed.

I have provided the full heap file so someone with more knowledge can get to the bottom of this.

heap-2024-03-15_05.04.56_Leak_Suspects.zip

`469,374 instances of “com.sk89q.worldedit.world.block.BlockState”, loaded by “cpw.mods.modlauncher.TransformingClassLoader @ 0x686293dc8” occupy 1,204,680,040 (40.96%) bytes.

Most of these instances are referenced from one instance of “java.lang.Object[]”, loaded by “”, which occupies 4,194,328 (0.14%) bytes. The instance is referenced by “it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap @ 0x6d100fa38”, loaded by “cpw.mods.cl.ModuleClassLoader @ 0x68319eaa8”.

Thread “java.lang.Thread @ 0x6c7664080 FileSystemWatchService” has a local variable or reference to “cpw.mods.modlauncher.TransformingClassLoader @ 0x686293dc8” which is on the shortest path to “java.lang.Object[1048577] @ 0x713000000”. The thread java.lang.Thread @ 0x6c7664080 FileSystemWatchService keeps local variables with total size 528 (0.00%) bytes.

The stacktrace of this Thread is available. See stacktrace. See stacktrace with involved local variables.

Keywords
com.sk89q.worldedit.world.block.BlockState
cpw.mods.modlauncher.TransformingClassLoader
java.lang.Object[]
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
cpw.mods.cl.ModuleClassLoader`

Expected Behavior

I expect it not to do this?

Reproduction Steps

  1. Host a server with World Edit
  2. ...Thats it

Anything Else?

No response

@dooblykid dooblykid added status:pending Pending acceptance or closure. type:bug Incorrect behavior, not working as intended labels Mar 15, 2024
@me4502
Copy link
Member

me4502 commented Mar 16, 2024

WorldEdit needs to inherently store a list of all blocks that exist, which is what your memory dump indicates is taking 1.2GB of space. This isn't a memory leak, this is another mod on your server massively abusing the concept of block states, leading to massive pollution of the block state list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:pending Pending acceptance or closure. type:bug Incorrect behavior, not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants