[MC-3303] Java Memory Leaks Created: 17/Nov/12  Updated: 09/Jul/14  Resolved: 09/Jul/14

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.4, Minecraft 1.4.5, Minecraft 1.7.4
Fix Version/s: None

Type: Bug
Reporter: Jack Caldwell Assignee: Unassigned
Resolution: Incomplete Votes: 4
Labels: None

Attachments: File MC Crash Report for Tails.rtf     PNG File Minecraft going mad.png     PNG File Over 1GB CubeTheThird.png     Text File crash-2013-03-22_15.07.23-client.txt    
CHK:
Confirmation Status: Unconfirmed

 Description   

Hello

I bought a laptop a few months back that is more than capable of running Minecraft in 64bit. I can supply more specs if required.

Whenever I boot Minecraft, javaw.exe takes up 400,000mb RAM (normal) and steadily climbs. In 15 minutes time, Java will have taken up all 8GB RAM, crashing my PC. Obviously this causes the frame rate to fluctuate. I have tried the following;

*Limiting the amount of RAM Java can take up upon execution of an application
*Installing 64 bit or 32 bit versions of Java on my 64bit machine
*Switching off and on features in the game
*Re installation of Java
*Uninstalling any conflicting apps (but nothing else uses Javaw.exe)
*Putting javaw.exe to high and realtime priority
*Changing the active cores from 2 to 1
*Using the web based applet in case the launcher was causing the problem
*Rolling back Java RE versions (tried current stable release and Java Runtime 5 stable)

None of this worked on vanilla Minecraft. Please help. There are other noted cases noted here (http://www.minecraftforum.net/topic/1335721-minecraft-125-memory-leak/).

Once again, please help. You can probably guess how desperate I am to play Minecraft again after my last computer broke.

Thanks in advance
Jack



 Comments   
Comment by Deleted account [ 09/Jul/14 ]

This ticket is incomplete without the requested information, no response has been received within a reasonable time and we are assuming the issue has been resolved. If you are still experiencing this issue, we can reopen it at your request.

Please review the guidelines before reporting issues.

Comment by Deleted account [ 06/May/14 ]

Is this still a concern in the current Minecraft version 14w18a / Launcher version 1.3.11 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by John Doe [ 19/Jan/14 ]

Yes, this is a concern in 1.7.4 as well. I have an 8GB ram and 64 bit java all running every other app fine for extensive periods, but Minecraft leaks really badly after about 15 mins. I have to keep leaving and opening up task manager in Windows 7 and keep ending process even after I quit the game, it still runs out of control. allocating more memory won't solve it either. it prolongs the inevitable which is worthless. I really checked up on everything with javaw and nothing else but Minecraft causes this to happen. I run the most basic simple default instllment of vanilla Minecraft too. nothing special. still happens.

Comment by Talven81 [ 26/Nov/13 ]

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Comment by Grave [ 11/Aug/13 ]

I'm also having major major memory leaks in 1.6.2. I've had this since 1.6.1, and it happened more when I had lots of mobs in water/severe amounts of particles. Now in 1.6.2 and launcher version 1.2.1, I'm having severe memory leaks of 200mb in seconds. Minecraft wasn't like this until 2-3 weeks ago, max (hadn't been playing due to massive lag regardless of memory leak).

I'm running Windows 7 64bit, Java 7 Update 25 for both 32 and 64-bit versions. Doesn't matter what settings I have in-game.

Comment by user-61562 (Inactive) [ 26/May/13 ]

It might be worthwhile to get a Program such as IOit's SmartRAM to clear up RAM automatically so it keeps Java's memory usage at a minimum.

This is defiantly a memory leak of sorts.

Comment by GuysImTristan [ 06/Apr/13 ]

Same problem...I have 3 gb usable ram minecraft uses all of it (((

Comment by [Mojang] Grum (Erik Broes) [ 04/Apr/13 ]

So if you do a clean install of minecraft, no custom texturepack, standing still in a flat world, memory will just run out of control?

Would you mind taking a snapshot of the memory using jvisualvm ? (Just a little program you can point at a java program, attach and get information from it). I'm almost sure the leak is not of the actual VM. This would just leave broken graphic drivers, but as said before, its likely more people would have this problem then.

Also, what good would porting Minecraft to C++ do?

Comment by Jack Caldwell [ 04/Apr/13 ]

Yeah, I'm sure it's a true leak as it doesn't stabilise. It does as I say stop now around 1.5GB - 2GB depending but the performance will be so poor it's unplayable as seen in the screenshots.

Okay, thanks for your help guys. I guess I'll try asking someone at a Java forum or StackExchange - will report back any findings here.

Would be interesting if any other X54c users experience the same problem (hopefully this will now appear high in search rankings) so we know if it's a a specific piece of hardware.

I could also pray Mojang release a C++ port :O

Cheers again

Comment by Markku [ 22/Mar/13 ]

Jack, as CubeTheThird explained a bit...

The number reported in the Minecrat client is the java's "heap" memory; it contains the allocated java objects (and maybe stacks, too, can't remember), whether still in use or as-of-yet-uncollected "garbage", and memory that has already been requested from the OS, but not in use for the java objects at that moment.

But Java will also need memory for its own internal stuff ("JVM") and for bunch of other things (like auxiliary data structures used for garbage collection); these are allocated outside that "heap", but they still show as being reserved by the java-process (when looked in task manager or such). It will typically also include things reserved by libraries loaded and used by the application (e.g. if some sound/graphics software has its own data structures).

That is why the value reported by operating system will be always higher. It is quite normal for that extra to be few hundred MBs. (I was a bit surprised to see my own results of upto 700MB extra, but since the usage somewhat stabilized there, I don't think it is leaking for me, or if it is, too slowly for me to spot).

If it is a true leak (in the JVM or external piece of software), the value reported by the OS will continue to grow. Such thing can not be fixed by Mojang, though it is always good to try and find the piece of code (or even hardware setup) that is doing it.

Comment by Jack Caldwell [ 22/Mar/13 ]

Forced crash on Minecraft after 20 seconds or so gameplay.

Comment by Jack Caldwell [ 22/Mar/13 ]

My bad, Tails. Real Crash report is uploaded now.

Cube, how much memory would you recommend allocating? I've tried 300MB, 400MB and 800MB limits but will completely bypass this limit.

Thanks

Comment by [Mod] CubeTheThird [ 22/Mar/13 ]

Because, as it says in your screenshot, a maximum of 900mb can be used, it's possible java has reserved memory should this amount be needed. If that is the case, it's not that surprising to see the actual memory consumption higher than the allocated amount (what with the java virtual machine and garbage collection to handle). That being said, it is still possible excessive memory is being used. If you execute Minecraft, allocating less memory than the normal amount, does this make any difference to the process size?

Comment by Tails [ 22/Mar/13 ]

A full error report has been saved to C:\Users\Owner\AppData\Roaming\.minecraft\crash-reports\crash-2013-03-22_15.07.23-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash

Comment by Jack Caldwell [ 22/Mar/13 ]

Tails - I have now attached the crash report. This report was generated just after MC booted up so will not show a huge amount of RAM eaten.

Markku - That's what I'm wondering. Does anyone have a different Java applet I could run so see if it's the same results (if so, obv wouldn't be a MC problem). I can't think of anything else that uses it right now.

CubeTheThird - I can't get it to go over 1.4gb any more (just fluctates above the mark pictured). Considering this picture shows "memory used" in the Minecraft window a completely separate number from the task manager, it's looking likely it's a Java issue and I may need to take it to Oracle.

Thanks for your guys continued support. Much appreciated.

Comment by [Mod] CubeTheThird [ 21/Mar/13 ]

This is true. You say this crashes your computer?

Comment by Erik [ 21/Mar/13 ]

I would like to point out that the attached screenshot shows 800+ MB of memory, not 8GB. 863,552KB == 843.3125MB This is quite a bit less than 1GB == 1,048,576Kb.

Comment by Markku [ 04/Mar/13 ]

That issue sounds like a leak in native code (i.e. inside JRE, drivers, LWJGL native parts, ...). When the JRE has been set an upper limit of like 1G, the memory for java-code should not be able to get past that limit, not even when garbage collection is being flunky; all one would get is java's own out of memory -exception.

Leak being in the native code might explain why so few experience it. It might only appear with specific hardware setup and Minecraft just happens to hit the right (or wrong) spot.

If the leak was in Minecraft's java code, [almost] everyone would be experiencing the problems. That is, getting OOM exceptions/crashes, but not the full 8GB used.

Nevertheless, would be nice to nail the reason, if for nothing else than to warn others about the specific hardware setup (or whatever the reason is found to be) somewhere.

Comment by Tails [ 04/Mar/13 ]

Please force a crash by pressing F3 + C for 10 seconds while ingame and attach the crash report here.

Comment by Jack Caldwell [ 04/Mar/13 ]

Still a problem. Tried launching in launcher which gives option to limit memory - completely ignores it.

Been 7 months unable to play Minecraft now ;(

Attached screenshot is about 4 minutes after launch

For reference, laptop is part of the Asus x54c series. Specs in original post.

Comment by Jack Caldwell [ 17/Nov/12 ]

Like I say, it doesn't matter how much it has allocated. Even if I do try starting it with a custom launcher that limits the RAM allocated to, say 800MB, Javaw.exe will still go right over this.

It's completely vanilla using the Minecraft launcher to start, but the web interface makes no difference. If you goto the link in my original post, some people are speculating it may be the garbage collector not functioning properly. If this is the case, it is out of the end users control.

Thanks for your replys, guys. I do appreciate this.
Jack.

Comment by [Mojang] Grum (Erik Broes) [ 17/Nov/12 ]

Minecraft doesn't get 8gb ram allocated. How are you starting it? Must be either a custom commandline or launcher.

Comment by Jack Caldwell [ 17/Nov/12 ]

For some reason, this bug is listed as minor. It is not for me as this has persisted since August 2012 when I got this laptop and there are many similar problems around the web saying that it breaks peoples games. There is a link in my first post.

Comment by Jack Caldwell [ 17/Nov/12 ]

Specs are as follows:

Laptop name: ASUS K54C
Processor - Intel Pentium CPU B960 @ 2.20GHz
OS: Windows 7 Home Premium 64 Bit
RAM: 8GB (Total physical memory 7.91GB)
Availible Virtual Memory: 12.9GB
Graphics: Intel "HD" on-board GPU

As stated, Java tried has been Java 7 Update 9 (latest)and I also tried Java 5 (without updates) but got the same results.

Comment by [Mod] CubeTheThird [ 17/Nov/12 ]

Please post some relevant information. What are your computer specs? What version(s) of java are you installing?

Generated at Sun Jan 12 12:00:46 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.