[MC-11439] Memory leak switching texture packs Created: 09/Mar/13 Updated: 02/Jul/13 Resolved: 06/May/13 |
|
| Status: | Resolved |
| Project: | Minecraft: Java Edition |
| Component/s: | None |
| Affects Version/s: | Minecraft 1.5, Minecraft 1.5.1, Snapshot 13w16a |
| Fix Version/s: | Snapshot 13w18c |
| Type: | Bug | ||
| Reporter: | Kahr | Assignee: | [Mojang] Grum (Erik Broes) |
| Resolution: | Fixed | Votes: | 11 |
| Labels: | crash, leak, memory | ||
| Environment: |
Java 1.6.0_43, Linux x86_64 |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| CHK: | |||||||||||||
| Confirmation Status: | Confirmed | ||||||||||||
| Description |
|
Switching texture packs several times eventually exhausts all available memory and crashes the game. Specifically, direct memory (as in ByteBuffer.allocateDirect), not the Java heap, fills up. This happens even without loading up a world. To reproduce this more easily, limit the amount of memory available to Java by adding -Xmx512M -Xms512M -XX:MaxDirectMemorySize=512M to the command line. |
| Comments |
| Comment by [Mojang] Grum (Erik Broes) [ 06/May/13 ] |
|
Fixed in 13w18c |
| Comment by Apocalypsing [ 25/Apr/13 ] |
|
I had some really odd trouble getting a 256x pack to load, when testing the 1.5.2 release. When I clicked on the 256x pack to select it, Minecraft would freeze, as usual, but then after some time, the default texture pack would come up selected instead. I repeatedly clicked the 256x pack again and again until Minecraft crashed due due a lack of memory allocated. I had 2GB out of my system's 8GB allocated just FYI. I also got an OS warning, where Windows was telling me that my system was low on free RAM (which comes to me as a surprise as I rarely go over >6GB of usage). I looked in Task Manager and saw that the JVM was using (wait for it...) 4GB of my RAM (in total 89% of my RAM was in use). So the memory leak appears to be in 1.5.2 too it seems. I haven't tested the 13w17a snapshot yet, I hope it's been fixed there, along with the poor FPS issues, which were only partly fixed in 1.5.2. Edit: forgot to mention I was running Minecraft under Java 6 (1.6.0.41). |
| Comment by Kahr [ 20/Apr/13 ] |
|
Affects 13w16a. |
| Comment by Tuomo Kämäräinen [ 06/Apr/13 ] |
|
I have 64-bit Java 7. The game runs fine with any 64x64 textures. With any 128x128 textures I get constant lag. I always have 30-100 FPS on my high-end PC. I wonder if the lag is related to this issue. |
| Comment by Kahr [ 19/Mar/13 ] |
|
Affects 1.5.1. |
| Comment by Mike [ 13/Mar/13 ] |
|
i see a very large memory leak with 256x texture packs and noted the game will go to 0 FPS and i have 5gigs allocated to minecraft and will will instantly fill all that up and freeze testing with 128x shows that it leaks but it runs around 8 FPS and testing with 64x it runs around 40-60 and using default 16x it runs fine hope this info helps |
| Comment by tyteen4a03 [ 13/Mar/13 ] |
|
This error can be reproduced by using an HD texture pack with a resolution of 256x256 or higher. Texture packs of resolution 64x64 and 128x128 may potentially produce the same results, but it will happen at a much slower pace. A client-side singleplayer version error: (Memory at that points hits around 220,000K, approximately 6GB of RAM was being used at that moment) |
| Comment by Tails [ 13/Mar/13 ] |
|
Note: Description: Rendering screen java.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Bits.java:632) at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:97) at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288) at bii.a(SourceFile:395) |
| Comment by Kumasasa [ 10/Mar/13 ] |
|
Can reproduce by switching Default -> Whoa -> Default 4 times (Default heap size) Java 7U17... Same crash report as already reported. 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/workbench_side.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/workbench_top.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/lava_flow.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/water_flow.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/fire_0.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/fire_1.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/lava.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/portal.txt 2013-03-10 17:44:16 [CLIENT] [INFO] Found animation info for: textures/blocks/water.txt 2013-03-10 17:44:26 [SERVER] [INFO] Stopping server 2013-03-10 17:44:26 [SERVER] [INFO] Saving players u: Rendering screen at bfk.b(SourceFile:791) at net.minecraft.client.Minecraft.K(SourceFile:595) at net.minecraft.client.Minecraft.run(SourceFile:524) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Unknown Source) at java.nio.DirectByteBuffer.<init>(Unknown Source) at java.nio.ByteBuffer.allocateDirect(Unknown Source) at bii.a(SourceFile:395) at bii.<init>(SourceFile:135) at bii.<init>(SourceFile:107) at bik.a(SourceFile:127) at bik.c(SourceFile:94) at bil.b(SourceFile:80) at bfy.d(SourceFile:351) at bfy.c(SourceFile:301) at bjr.a(SourceFile:146) at axn.a(SourceFile:175) at bjq.a(SourceFile:109) at bfk.b(SourceFile:768) ... 3 more 2013-03-10 17:44:26 [SERVER] [INFO] Saving worlds 2013-03-10 17:44:26 [SERVER] [INFO] Saving chunks for level 'Test-Welt'/Overworld 2013-03-10 17:44:26 [SERVER] [INFO] Saving chunks for level 'Test-Welt'/Nether 2013-03-10 17:44:26 [SERVER] [INFO] Saving chunks for level 'Test-Welt'/The End 2013-03-10 17:44:36 [CLIENT] [INFO] Stopping! |
| Comment by Kahr [ 10/Mar/13 ] |
|
I first saw the crash with Misa's 1.5 texture pack, but since that's unreleased I made my own pack to illustrate the problem. Attached whoa15.zip which upscales the default textures to 64x and adds a 30-frame animation to each. Here's another crash report with the default heap size (1772MB in my case). Switching between default and whoa15.zip 4-5 times was enough to exhaust direct memory and crash. |
| Comment by Kumasasa [ 10/Mar/13 ] |
|
Cannot reproduce. Maybe an upgrade to Java 1.7 will solve your issue. |