pop4959 / Chunky

Pre-generates chunks, quickly, efficiently, and safely.
GNU General Public License v3.0
556 stars 63 forks source link

Chunky cause memory crash and force close if left to generate while in pause menu. #333

Open SillyPuffin opened 4 months ago

SillyPuffin commented 4 months ago

Bug description When in the menu for an extended period of time memory fills up to 99% while generating chunks (I did this to stop day/night passing and discovered crash as side effect). If you then leave the menu it fps drops to multiple seconds a frame and then the window stops responding and I have to wait for windows to force close it.

To Reproduce

  1. first get chunky and start a relatively large radius generating.
  2. Open the pause menu and wait for memory to fill up (open F3).
  3. once at 99% close menu and watch game freeze.

Screenshots 2024-04-16_17 45 22

Mods chunky fabric api

Runtime info:

Crash reports / logs latest.log

additional context This is a client side single player world - not a server so I have to be on the world to activate chunky.

not a memory limited issue, if I had more memory it would simple keep climbing to that limit. I used less for the sake of time when reproducing. If you are not paused the leak does not happen and memory stays at a normal usage while generating. I also tested to make sure it wasn't just a Minecraft issue and it does not leak when in pause menu at idle.

EDIT I tested again using 4GB of ram and the JVM arguments for garbage collection from alkais scripts and it still eventually filled up and crashed while in pause menu. I guess the easy fix is not opening pause menu lol but I kind of want to know what causes it.

pop4959 commented 4 months ago

I've had one or two people mention this in Discord before. Not sure if it's a bug in chunky - my guess is that the client does not expect to be loading chunks while the game is paused, so something prevents them from unloading.

As you mentioned, a super easy workaround is to simply not pause (open up the chat window instead and tab out, etc).

I'll leave this open until I have more time to investigate and determine what the problem is here.

hashrsyndicate commented 4 months ago

I had the same problem today, the first time I had only 8 gb set for Minecraft and it locked up around 8% on a 5k radius. The second run I set the memory to 32 gb and made it to a little past 25% before hitting near the memory limit. I was able to pause chunky then exit and save from the game but the save took about 10 mins. I have started it back up and will just do it in batches. You can tell that it is doing some garbage collection as the usage fluctuates up and down but over time it gradually eats up more and more memory. I am also running it from the pause screen but that is specifically to not advance the age of the world.

Barerock commented 2 months ago

I was wondering how pregenerating could possibly be feasible when each job freezes after less than 4%. Turns out I ran into this issue. Now I know and can wait til this smaller job is done to see how big it can go. Currently at 8%.

pop4959 commented 2 months ago

I was wondering how pregenerating could possibly be feasible when each job freezes after less than 4%. Turns out I ran into this issue. Now I know and can wait til this smaller job is done to see how big it can go. Currently at 8%.

Please do not reply with unrelated questions or general support requests, as it sends an email to everyone following this issue. The Discord server is the correct place to ask such questions.