mojira.dev
MC-301664

Weakly-loaded chunks will accumulate projectiles indefinitely, causing lag or memory overflow

Snow golems can continuously shoot snowballs. If these snowballs travel beyond the simulation distance, they accumulate, potentially causing a memory overflow or server crash. Before a crash occurs, if player movement causes the simulation distance to load tens or even hundreds of thousands of accumulated snowballs, will experience a lag spike lasting for some time.

(Even with the simulation distance set to 16, it’s not immune—weakly-loaded chunks still exist.)

It’s not limited to snowballs—this can happen with any projectile, such as llama spit.

This simple device can be built on any survival server—just position a few snow golems at the edge of weakly-loaded chunks; it's extremely easy.

How to reproduce

  1. Set up a vanilla server with enable-command-block (enableCommandBlocks game rule in 25w35a+) set to true, simulation-distance set to 5, and view-distance set to 6.

  2. Run the server with the attached world

  3. Press the button next to the gold block to start reproducing

  4. Stay on the diamond block

  5. Wait awhile (you can speed things up by using /tick sprint)

  6. Click on the lever connected to the repeating command block to see how many snowballs are in the world
    Notice how the message is getting bigger

  7. Click on the button connected to the normal command block
    Notice how many snowballs flew out

Observed Behavior
Projectiles will accumulate if the simulation distance is lower than the render/view distance.

Expected Behavior
Projectiles will not accumulate to the point where they can lag the game or crash the server.

Linked issues

Attachments

Comments 2

Please edit your report to change the Affected Version to the version shown on the Minecraft title screen

CatTea

(Unassigned)

Confirmed

(Unassigned)

1.21.8

Retrieved