After switching between worlds like 25 times, minecraft runs out of memory
I created 2 new superflat worlds with the "Redstone Ready" template.
Each time i switch to another one of these, the game consumes 60 - 100 mb more ram!
What I expected to happen was...:
I expected to be able to switch between singleplayer worlds as much as i want
What actually happened was...:
Minecraft starts using more and more ram, making it crash because it's out of memory
Steps to Reproduce:
1. Leave current world
2. Join another world
3. Leave this world
4. Join another world
And so on like 25-35 times until minecraft crashes
Linked issues
is duplicated by 3
Attachments
Comments 31
It's crazy, I know, but Minecraft does suffer from memory leaks.
The best course of action you can take at present would be restarting the game after the 20th time you've switched maps. Or, assuming that you are trying to transfer something from Creative to Survival, take photos of whatever you've built so you don't have to swap the maps so much.
I frankly think this will be a tough one to solve, as this (plus the other memory leaks) have not been resolved for a while now.
Yeah for me it's not too big of a problem that i have to restart minecraft after some switching, but it should not be necessary. Also it are just normal flat sandstone worlds with nothing special in them
Even with limited block types, there can be memory leaks in other areas. All games suffer from memory leaks, the question is how severe is the leak. Minor leaks can usually be ignored while major leaks need to be fixed as it can become overbearing on the system. That was one of the reasons for pulling back on 1.4.1 and instead releasing 1.4.2.
To make this bug report more complete, I would recommend the following:
Upload the map(s) you are working on.
Report how much ADDITIONAL RAM is consumed between each switch. 2 switches won't give you an accurate number, but if you do it a few times you should be able to see an average amount of consumed RAM that isn't released as the working set size increases.
Some new information about this bug.
I created 2 new superflat worlds with the "Redstone Ready" template.
Each time i switch to another one of these, the game consumes 60 - 100 mb more ram!
This is more than i expected to be.
Cannot confirm.
Did the same (created 5 worlds, exited each after 5-15 minutes)
Created 5 Worlds, see screenshots.
javaw.exe RAM usage at the end: 1076 M
Callum, were those memory usage numbers observed in an operating system tool, or in the client itself? If former, it is normal (I can easily reach 1.7G usage with java's max parameter set for 1G). If latter, there would be a bug in the JVM itself (not obeying the max parameter). (The maximum parameter specifies the java's maximum internal 'heap' size, not the maximum RAM the JVM can request from the operating system.)
Coming to think of it, as you have such a humble CPU (by modern standards), what is your system's total RAM amount?
Also note that there is currently a bug that puts weaker CPU's to knees (and dual-core 1.3GHz would be counted as weak in this context), related to zombie's pathing (MC-17630)... Combine that with the increased need for garbage collection once the heap starts getting full (like during your 4th world), and bad performance can be expected. A good test to try would be run the game on peaceful difficult (no zombies to wreck the CPU...)
Contrary to Kumasasa's request, I installed the latest development version of java, java 8, and found all the performance problems vanish. The cpu is still fairly high but the RAM stays low, and my fps stuck to vsync even whilst loading worlds.
I have the same problem. I changed 10 or 12 times between different worlds and Minecraft crashed.
Mac OS X 10.7.5. Java 1.6. Minecraft 1.6.2.
Sounds like a memory leak. This could happen due to loading worlds and all assets not being unloaded when leaving.