I just noticed that the launcher got another update (1.5) and one of these updates is that there are new default JVM args. Before, there was only -Xmx1G, but now there is
Xmx1G sets maximum heap size to 1GB of RAM, while Xmn128M sets minimum heap size to 128MB of RAM. I don't recognize the others. Google will probably know.
-Xms : min heap size. Having -Xms = 1.8GB (32bit) can be bad, because you don't let memory for anything else.
-Xmn : the size of the heap for the young generation Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often. All new objects are created into the young generation region (called "eden"). When an object survive is still "alive" after more than 2-3 gc cleaning, then it will be swap has an "old generation" : they are "survivor". Good size is 33%
Based on this, they think the game actually only needs about 384 MB of memory (-Xmn = 33% of heap size); not sure what you would set it to for different values of -Xmx (for example, I allocate 512 MB; 32 bit systems aren't that happy with more than this; at least in my experience higher render distances cause out of memory errors with 1 GB allocated, not because the heap is running out but because the Java process runs out of process space, and 512 MB is fine otherwise).
Also, I find that I have to use the argument -Xss1024K to avoid stack overflow crashes in 1.7+ (usually something to do with water and lava, sounds like this issue here); this is the default stack size for 64 bit systems but 32 bit systems like mine only allocate 320 KB):
On Windows, the default thread stack size is read from the binary (java.exe). As of Java SE 6, this value is 320k in the 32-bit VM and 1024k in the 64-bit VM.
I've always used Minecraft with 4Gb allocated and it was flawless. But now it won't let me allocate more than 1Gb and my game keeps crashing due to "Minecraft has run out of memory"
I don't recommend changing the amount of memory for Minecraft. 1GB is fine, stick with 1GB.
I am not sure but perhaps setting to a fixed amount of memory rather than dynamic memory will be faster. Do this by putting in -Xms1G.
You should rather allocate as little memory as possible, to avoid it getting swapped to disk. Quoting from the Optifine thread:
Lauch Minecraft with less memory (yes, really). Usually it does not need more than 350 MB and runs fine on all settings with the default texture pack. By default java allocates way too much memory (1GB) which may get swapped to disk and the overall performance may suffer a lot.
Not if you have Mac OS X; it handles memory very well, it is quite hard to get it to swap memory to disk. I once ran minecraft with 512GB memory allocated to it and 16GB Youth generation limit when i only had 8GB memory, and guess what? Minecraft actually only used 3-4 GB memory! And no swapping at all!
On other operating systems you probably have to be more careful, as far as I know Windows doesn't have any special memory management and just manages it the classic way.
I once tried allocating half a gigabyte to Minecraft. It worked fine for multiplayer but it did very bad in singleplayer. It would get full so often, and after a few relogs in the world, Minecraft would crash.
I've always used Minecraft with 4Gb allocated and it was flawless. But now it won't let me allocate more than 1Gb and my game keeps crashing due to "Minecraft has run out of memory"
Did you loose your 64-bit Java? You need 64-bit to allocate more then 2GB.
Java is incapable of using 512GB of ram as it is a VM. If you have some kind of daisy chained mobo with 64 slots for memory, then you have no legitimate reason to post a question like that, especially on minecraftforums, as you should know more than everyone here about memory management applications to have a rig that custom.
Rollback Post to RevisionRollBack
I don't cheat; I just conveniently write the rules.
Java is incapable of using 512GB of ram as it is a VM. If you have some kind of daisy chained mobo with 64 slots for memory, then you have no legitimate reason to post a question like that, especially on minecraftforums, as you should know more than everyone here about memory management applications to have a rig that custom.
It didn't actually use 512GB ram and I didn't have that much RAM. I just allocated that and it said it was allocated in the F3 menu, but in the Activity Monitor it only used like a gigabyte or two.
It is worth noting that Java 8 does not recommend using the "-XX:+CMSIncrementalMode" argument and will give a warning if you use it, saying it is deprecated and will be removed in a future version (as noted here); given this, it is sort of odd that Mojang added it.
It is worth noting that Java 8 does not recommend using the "-XX:+CMSIncrementalMode" argument and will give a warning if you use it, saying it is deprecated and will be removed in a future version (as noted here); given this, it is sort of odd that Mojang added it.
What exactly does that special garbage collector do? Why did Mojang add that?
-Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M
What do each of these JVM args do? Why were they added?
Actually, -Xms sets the minimum heap size; Xmn sets the size of the "young" generation, objects with a short lifetime:
Based on this, they think the game actually only needs about 384 MB of memory (-Xmn = 33% of heap size); not sure what you would set it to for different values of -Xmx (for example, I allocate 512 MB; 32 bit systems aren't that happy with more than this; at least in my experience higher render distances cause out of memory errors with 1 GB allocated, not because the heap is running out but because the Java process runs out of process space, and 512 MB is fine otherwise).
Also, I find that I have to use the argument -Xss1024K to avoid stack overflow crashes in 1.7+ (usually something to do with water and lava, sounds like this issue here); this is the default stack size for 64 bit systems but 32 bit systems like mine only allocate 320 KB):
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
Thanks for the clarification.
I am not sure but perhaps setting to a fixed amount of memory rather than dynamic memory will be faster. Do this by putting in -Xms1G.
You should rather allocate as little memory as possible, to avoid it getting swapped to disk. Quoting from the Optifine thread:
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1272953-optifine-hd-a4-fps-boost-hd-textures-aa-af-and
Not if you have Mac OS X; it handles memory very well, it is quite hard to get it to swap memory to disk. I once ran minecraft with 512GB memory allocated to it and 16GB Youth generation limit when i only had 8GB memory, and guess what? Minecraft actually only used 3-4 GB memory! And no swapping at all!
On other operating systems you probably have to be more careful, as far as I know Windows doesn't have any special memory management and just manages it the classic way.
I once tried allocating half a gigabyte to Minecraft. It worked fine for multiplayer but it did very bad in singleplayer. It would get full so often, and after a few relogs in the world, Minecraft would crash.
Did you loose your 64-bit Java? You need 64-bit to allocate more then 2GB.
I'd say it's pretty obvious he means 512M.
No, I meant 512GB.
I don't cheat; I just conveniently write the rules.
Oops, did I steal your mod? Well, I'm lazy, so if I found the motivation to do so, you did something wrong as a developer.
Additional Buildcraft Objects: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2310397
I'm currently also working on Remain in Motion. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2104611
I can't advertise the others....
My Patreon: https://www.patreon.com/DA3DSOUL
It didn't actually use 512GB ram and I didn't have that much RAM. I just allocated that and it said it was allocated in the F3 menu, but in the Activity Monitor it only used like a gigabyte or two.
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
What exactly does that special garbage collector do? Why did Mojang add that?