WorldEdit

WorldEdit

43M Downloads

OutOfMemoryError when using WorldEdit

Supermarcel10 opened this issue ยท 2 comments

commented

WorldEdit Version

7.2.12

Platform Version

Forge 1.19.2-43.3.8

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

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "WorldEdit Session Manager"

No further stack-trace.
Crash report

Expected Behavior

No exception should be thrown.

Reproduction Steps (In my case)

  1. Create a container with predefined CPU threads and Memory.
  2. Install FTB Skies Expert modpack with the default configuration.
  3. Install WorldEdit 7.2.12 and add to container/mods/ directory.
  4. Run server and the server thread kills itself during start-up.

Steps to Fix

  1. Edit Java execution to include -XX:MaxRAMPercentage=95.0 or similar.
  2. Rerun the server and no exception occurs.
commented

Upon investigating further, it doesn't seem to be an issue with the modpack, but rather entirely WorldEdit. It seems there is a bug with how WorldEdit calculates something based on allocated memory.

When using a container (which was my case), I didn't set a max memory size, since I didn't have the need to - I just allowed it to use as much as the container has assigned for CPU, Mem and Disk.

It seems to be an issue with WorldEdit basing something on the allocated memory size, either using -XX:MaxRAMPercentage=95.0 or -Xmx{MEMORY_SIZE}m. It would probably be a wise idea to get that checked and fixed either way, since it doesn't seem so smart to kill the entire main thread because WorldEdit felt like it.

commented

You most likely have a very broken mod that's abusing the concept of block states. Mods like WorldEdit inherently need to list all block states that exist in the game, which is a near-instant and fairly light process.

If a mod abuses block states to the point where there are hundreds of millions on the server, then it can take a while and use a lot of resources. This is an issue with whatever mod is abusing block states, as that data should be in BlockEntity data at that point. In newer versions we have detectors that will tell you what mods are causing these issues.