Normally I wouldn't post what seems to be a Java specific problem here, but since I can only reproduce the problem with minecraft, and cannot find any reference to this problem on Google, I decided to post it here.
Basically when I load a single player save, the javaw.exe process hosting minecraft starts to constantly consume more ram. Usually it's too slow to be a problem, but in some maps, java quickly consumes all 4gb of ram, prompting windows to start desperately filling the pagefile, and slowing the entire computer.
In one of my maps, I have quite a large and complicated redstone circuit (from bedrock to sky, and spanning a 300x300 block area). In the first ~30 seconds, I can play the map lag free, well after all the chunks have loaded, but then I run out of ram and the game grinds to a halt. Using the F3 status screen in game reveals that minecraft is only consuming 120mb out of its allocated 900mb, so it's not an issue of minecraft using too much memory - it appears to be some sort of memory leak, maybe with Java's GC.
Is anyone else having this issue, and if so, have you found a way to stop it? I'm considering falling back to Java 1.6, but am liking the performance boost of 1.7...
I'm running minecraft 1.8 on Java build 1.7.0 x64, and it's the only java runtime installed on my system (windows 7 x64).
Another thing to add is that this latest version of minecraft (1.8) has massive memory leaks and "ghosts," data that minecraft writes but leaves once its done instead of deleting.
Yeah, I do some developement in .NET and forgetting to call .Dispose() causes a lot of similar memory usage, except it's usually cleaned up by the garbage collector, in this case however it is not.
Quote from Garmine »
Maybe you should try installing the 32 bit version of java, and run MC with it, I herad about some issues with MC and 64 bit java.
I installed 32 bit Java v1.7.01 and selected that as the preferred JRE, except it still uses over 3gb of ram (which is kind of weird, considering it's only 32 bit and should only be able to use 2gb...)
I may just do a full java uninstall and reinstall and see what happens.
You could try the -xincgc switch if you launch java from a batch file or command line... that changes the way that the garbage collector works to being continuously on, however it can decrease the garbage collectors overall performance.
I ran it with java -client -Xincgc -cp Minecraft.exe net.minecraft.LauncherFrame, still no luck...thanks for the suggestion though.
Maybe minecraft is using 3gb of ram, and just isn't telling me? when I rotate the camera, I get huge freezes while Windows accesses the paging file, indicating that minecraft is actually making use of some of the memory that it's consuming...
It's just strange that when I hit f3, minecraft only reports using 120mb of ram or so, out of a possible 900mb. javaw.exe is using over four times minecrafts supposed "allocated memory", so something doesn't add up. And I don't remember it doing this with java 1.6....anyway I'll tell you guys if I get anywhere in terms of solving it.
The Meaning of Life, the Universe, and Everything.
Did either of you get this fixed? This is my issue too. Whenever I get near an area with a lot of trees, and my graphics on fancy, everything stutters as my memory fills up and and up, and then crashes once it hits 1.5 gigs or so. Java.exe is using TONS of memory. I have Java 7, but I've tried going back to 6 and cleaning away previous versions, everything. Nothing helps. What did you guys do to fix it???