WorldEdit

WorldEdit

43M Downloads

World Edit causes MASSIVE memory leak in server.

dooblykid opened this issue · 2 comments

commented

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

commented

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.

commented

This issue has been automatically marked as stale because it has not been fully confirmed. It will be closed if no further activity occurs. Thank you for your contributions.