mojira.dev
MC-37900

Moving fast causes out of memory and freeze

I tried to recreate a memory leak I found in 1.6.2 and instead got a different bug.

When I explore a single-player world too fast, the chunkloader loads too much data in too little time, and a possible memory leak causes an inevitable crash.

Doesn't affect multiplayer servers.

Steps to reproduce
Load or create a 'normal' single-player world with creative.
Fly
Use Zombe's modpack (which isn't out for 1.7.2 yet) to fly at 10 times normal speed and explore the world for a couple of minutes.
Alternatively: Type /tp 0 100 1000 and wait for the ground to show up, then increase the z coordinate with 1000 and repeat.

I'm using default memory allocation in case of Zombe's modpack and 256MB in case of /TP-ing.

Expected behavior
Can keep exploring the world indefinitely.

Actual behavior
After about 2 minutes of flying (or about 6 times /tp), video starts lagging. When continuing to explore, the lag becomes as severe as hanging ~15 seconds, and will cause an OutOfMemory exception, a died thread (the Server thread). and weird behavior

This weird behavior is: the ground doesn't show up and cheats stop working. When going back to the menu and trying to load the level again, it freezes hard (I have to terminate the process).

The 'Used memory' in the F3 screen never reaches 100% even when the crash already occurred.

The two logs are from two different instances of me successfully recreating this bug.

FYI, what happened in 1.6.2: I get a neat menu-like error message with the options to exit or go back to menu. When selecting back to menu, I see the server list instead of the main menu (even though it was a single player game).

Related issues

Attachments

Comments

migrated
[media][media][media][media][media][media]
kumasasa

Can not reproduce in vanilla Minecraft.

Unless reproducible in vanilla this is either invalid or simply assigned too less mem.

kumasasa

Minecraft does not run with 256 MB

migrated

With default memory (1024MB if I'm not mistaken) I could not reproduce the bug in a reasonable amount of teleports. After 50 TPs the memory usage grew above 70%, then after 10 more TPs memory usage was back to below 50%.

This doesn't take away that with 256MB (-Xms256m -Xmx256m) the bug DOES appear in vanilla. My guess is that the margin applied by either the chunk unloader or garbage collector doesn't account for a too small memory.

kumasasa

Sure, with 256 MB that may be happen in vanilla, but the launcher assigns 512 MB for 32 bit OS and 1 GB for 64 bit OS.
If you deliberately reduce the memory, it's not Minecraft's fault if anything unexpected happens.

migrated

(Unassigned)

Unconfirmed

crash, freeze, memory-leak, singeplayer

Minecraft 1.7.2

Retrieved