WorldEdit

WorldEdit

43M Downloads

Error loading large scope Schematic: java.lang.OutOfMemoryError: Java heap space

Jaffe2718 opened this issue ยท 1 comments

commented

WorldEdit Version

7.2.15+6463-5ca4dff

Platform Version

Fabric 0.14.21

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

A memory error occurred when I loaded the large schematic file and pasted the structure.The space scope of my Schematic file is unusually big,14751462201=433446450 blocks. When WorldEdit module paste this special big Schematic file, will appear the java.lang.OutOfMemoryError: Java heap space problem. Since I'm not familiar with WorldEdit's source code, I can only guess that the module's resource scheduling mechanism may not be reasonable. When loading a large-scale Schematic structure, isn't it simple to parse all of it straight into memory, then write it to an archive? I guess the working mechanisms of WorldEdit. Because once caused the java.lang.OutOfMemoryError: Java heap space problem, is totally not paste any block. If memory is insufficient, for a personal computer, memory is limited, is it impossible to load such a large Schematic structure? If so, is it possible to optimize this mechanism: for example, once the parsed blocks in memory reach 1GB, the blocks are placed and written to the archive, and then continue to parse the blocks, rather than putting them into memory at once?

Expected Behavior

No matter how large the Schematic file is, it should load successfully.

Reproduction Steps

  1. launch Minecraft 1.20.1 + Fabric 0.14.21 + WordEdit 7.2.15+6463-5ca4dff
  2. execute the command //schem load hunnu_w.schem, and the game client show me hunnu_w.schem loaded. Paste it with //paste, it means that the schematic file has already loaded successfully
  3. execute the command //paste -aom #existing, than I see java.lang.OutOfMemoryError: Java heap space

Anything Else?

This is the log file of the game running
latest.log

commented

This is essentially an idea I've had for a while, but is hard to implement. Closing in favor of the new issue for it: #2350