The -Xmx and -Xms values are always the same. Why?
In F3 debug screen, there is a percentage. Usually it would say Allocated memory: 100%
Whats this about?
Is the allocated memory dynamic or fixed? If i allocate 7 gb (and my ram is 8 gb), then will other programs only have 1gb to use? or is it dynamic so that even though minecraft has 7gb allocated, but minecraft only uses 2gb of it, then other programs would have 6gb to use?
What happens if i allocate more memory than the capacity of my Ram?
The -Xmx and -Xms values are always the same. Why?
-Xms isn't the "minimum" necessarily, it's the "starting" memory. Which, I guess, is still a minimum in some way, because once the allocated memory goes up, it never goes back down until you quit the program. If you did, for example, "-Xms512M -Xmx1G," then it would start with half a gig (512 megabytes) allocated, and would be "allowed" to take up to 512 more if needed. If you do "-Xms1G -Xmx1G," then it will start with the full gig and won't be allowed to take any more.
In F3 debug screen, there is a percentage. Usually it would say Allocated memory: 100%
Whats this about?
That is the amount currently allocated, compared to the maximum amount set by -Xmx. If your -Xms and -Xmx are the same, this will always say 100% because it is using all that it can, right from the start. If on the other hand you do something like "-Xms1G -Xmx2G," then it will say 50% when it starts, and it will increase towards 100% if and when it takes any more.
Used Memory: how much is being actively used, out of what is currently allocated.
Allocated Memory: how much is currently allocated, out of how much can be allocated if asked for.
Is the allocated memory dynamic or fixed? If i allocate 7 gb (and my ram is 8 gb), then will other programs only have 1gb to use? or is it dynamic so that even though minecraft has 7gb allocated, but minecraft only uses 2gb of it, then other programs would have 6gb to use?
That's what "allocated" means. If it's allocated to Minecraft, it's not available for other programs.
What happens if i allocate more memory than the capacity of my Ram?
Very bad things. I wouldn't do that if I were you. Make sure to leave at least a gig or two for other programs and your OS itself. It's not recommended to allocate more than half your total memory to Minecraft. Also, unless you're using shader mods or something, I mean I have a crummy computer and Minecraft actually runs just fine on half a gig or less. I never understand why people feel the need to allocate 4G or more. If I had plenty of it available (I only have 2G, total) I might give it as much as 1 or maybe even 2G so I could use "far" render distance instead of "normal," but unless your mods demand it, there's really no reason to go above that in vanilla Minecraft. I just use "-Xms256M -Xmx512M" and it works just fine.
It would be unwise to allocate your entire memory; the game, and the rest of your system, will very likely have issues because of lack of fast memory. I don't know what'll happen, but all you need to know is not to do it. You could do it if you REALLY want to, but the system will probably resort to pager (disk) RAM, which can be very, very slow.
If I had plenty of it available (I only have 2G, total) I might give it as much as 1G so I could use "far" render distance instead of "normal," but unless your mods demand it, there's really no reason to go above that in vanilla Minecraft.
Just an interesting note, I run on 32 bit and using Far (16 chunks) render distance with 1 GB allocated is asking for an out of memory crash, while oddly enough allocating 512 MB runs without problems, if with a lower frame rate than I like in complex areas (jungles, etc). Also, just before out of memory occurs the game claims to still have plenty of free RAM (F3); it appears that what is actually happening is that the entire Java process is running of of memory (you have RAM for Minecraft itself, then RAM used by other Java stuff (OpenGL, etc), which must all fit within 2 GB on a 32 bit OS (I have 3 GB of RAM but a single process can only use 2 GB of that), it appears that textures and stuff are stored outside of the heap, so higher render distances use more memory but not from what you see using F3). The Optifine thread claims that 350 MB is enough to run at max settings using default textures, etc, although I'd go with 512 MB to provide some headroom.
Note also that there are two different out of memory crashes; the one I'm referring to here is the "Minecraft has run out of memory" screen; by contrast, if the heap space is exhausted the game lags badly for a few seconds as the garbage collector works overtime to free memory, then locks up, followed by a hard crash with "java.lang.OutOfMemoryError: Java heap space" as the cause in the console.
Also, as far as setting Xms and Xmx, I've heard that it is preferable to make them the same to avoid lag spikes when the memory allocation changes (I set both of them to 512 MB myself so all the memory available is allocated from the start).
In this post
http://www.minecraftforum.net/topic/1395030-tutorial-allocate-more-memory-for-minecraft
The -Xmx and -Xms values are always the same. Why?
In F3 debug screen, there is a percentage. Usually it would say Allocated memory: 100%
Whats this about?
Is the allocated memory dynamic or fixed? If i allocate 7 gb (and my ram is 8 gb), then will other programs only have 1gb to use? or is it dynamic so that even though minecraft has 7gb allocated, but minecraft only uses 2gb of it, then other programs would have 6gb to use?
What happens if i allocate more memory than the capacity of my Ram?
-Xms isn't the "minimum" necessarily, it's the "starting" memory. Which, I guess, is still a minimum in some way, because once the allocated memory goes up, it never goes back down until you quit the program. If you did, for example, "-Xms512M -Xmx1G," then it would start with half a gig (512 megabytes) allocated, and would be "allowed" to take up to 512 more if needed. If you do "-Xms1G -Xmx1G," then it will start with the full gig and won't be allowed to take any more.
That is the amount currently allocated, compared to the maximum amount set by -Xmx. If your -Xms and -Xmx are the same, this will always say 100% because it is using all that it can, right from the start. If on the other hand you do something like "-Xms1G -Xmx2G," then it will say 50% when it starts, and it will increase towards 100% if and when it takes any more.
Used Memory: how much is being actively used, out of what is currently allocated.
Allocated Memory: how much is currently allocated, out of how much can be allocated if asked for.
That's what "allocated" means. If it's allocated to Minecraft, it's not available for other programs.
Very bad things. I wouldn't do that if I were you. Make sure to leave at least a gig or two for other programs and your OS itself. It's not recommended to allocate more than half your total memory to Minecraft. Also, unless you're using shader mods or something, I mean I have a crummy computer and Minecraft actually runs just fine on half a gig or less. I never understand why people feel the need to allocate 4G or more. If I had plenty of it available (I only have 2G, total) I might give it as much as 1 or maybe even 2G so I could use "far" render distance instead of "normal," but unless your mods demand it, there's really no reason to go above that in vanilla Minecraft. I just use "-Xms256M -Xmx512M" and it works just fine.
Village Mechanics: A not-so-brief guide - Update 2017! Now with 1.8 breeding mechanics! Long-overdue trading info, coming soon!
You think magic isn't real? Consider this: for every person, there is a sentence -- a series of words -- which has the power to destroy them.
My fan fiction of the game: http://www.minecraftforum.net/topic/1957118-programmer-my-first-fan-fiction/#entry24096758
Just an interesting note, I run on 32 bit and using Far (16 chunks) render distance with 1 GB allocated is asking for an out of memory crash, while oddly enough allocating 512 MB runs without problems, if with a lower frame rate than I like in complex areas (jungles, etc). Also, just before out of memory occurs the game claims to still have plenty of free RAM (F3); it appears that what is actually happening is that the entire Java process is running of of memory (you have RAM for Minecraft itself, then RAM used by other Java stuff (OpenGL, etc), which must all fit within 2 GB on a 32 bit OS (I have 3 GB of RAM but a single process can only use 2 GB of that), it appears that textures and stuff are stored outside of the heap, so higher render distances use more memory but not from what you see using F3). The Optifine thread claims that 350 MB is enough to run at max settings using default textures, etc, although I'd go with 512 MB to provide some headroom.
Note also that there are two different out of memory crashes; the one I'm referring to here is the "Minecraft has run out of memory" screen; by contrast, if the heap space is exhausted the game lags badly for a few seconds as the garbage collector works overtime to free memory, then locks up, followed by a hard crash with "java.lang.OutOfMemoryError: Java heap space" as the cause in the console.
Also, as far as setting Xms and Xmx, I've heard that it is preferable to make them the same to avoid lag spikes when the memory allocation changes (I set both of them to 512 MB myself so all the memory available is allocated from the start).
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?