1. The Rules of Spacebattles are now in a convenient location. Read them. Do it now.
  2. Welcome Guest to the new SB! Come on in, we're running the newest XF version now on new servers. Talk about it here: http://forums.spacebattles.com/threads/all-in-together.311779/
  3. Alamo, dacis2, Erisah Mae, and KnightErrant are now Moderators. I for one welcome your new overlords, and so should you! - CommanderRazor on behalf of the SB Staff

How to set Minecraft's memory allocation - the Ghetto way.

Discussion in 'Minecraft' started by Kerrus, Sep 17, 2011.

Thread Status:
This thread lies dormant for more than 14 days. Restarting it causes mods to gaze in your direction.
  1. Kerrus

    Kerrus Murder Pony

    This may not work for all of you- hell, it may not work for any of you, but it's been requested and this is the only way I know how.



    Your minecraft install is located in either \appdata\.minecraft (for pre-vista windows users).

    Or in \appdata\roaming\.minecraft (for vista/win7 users)


    In there you will find a file called Minecraft.exe- which you use to launch Minecraft itself.



    I don't know if you can leave the file name the same- I've never tried, but this is my solution to allocating memory and making it work where it would otherwise not work.



    Step 1: Rename your Minecraft.exe to Minecraft.jar. (Yes I'm aware you have a minecraft.jar in the \bin directory- don't touch that one)

    Step 2: Use notepad to create a .txt document with the following text:


    java -Xmx1024m -Xms1024m -jar minecraft.jar

    And save it to your .minecraft directory.

    Then rename it to "Run.Bat"


    Then double click it. It should launch Minecraft, but with the specified memory parameters- xmx being the max memory minecraft will use (any more than 1024 tends to wig out for most people- mine will wig out beyond 800), and xms determines your initial heap size.


    For added complexity you can add a -Xmn100m (which determines the rate at which your Java Virtual Machine handles garbage collection- although unless you're running a server this last argument isn't strictly necessary.



    So yeah, this is Kerrus' incredibly ghetto minecraft tutorial.

    Enjoy.
     
  2. Soulgazer

    Soulgazer Dunno what to put here

    Forgive my computer noobishness, but what does this do again? AKA its purpose?
     
  3. dacis2

    dacis2 Civil Servant Moderator

    If you get the message "Minecraft has run out of memory" very often, or you game crashes after a few minutes every time, then it's probably because they didn't allocate enough memory for Java. Mine runs at around 900mb
     
  4. Aiyel

    Aiyel Space Communist

    if you've the ability to do so, upgrade to 64-bit Java. It inherently has higher memory allocation.
     
  5. Soulgazer

    Soulgazer Dunno what to put here

    Also: Use debug to check your allocated memory and used memory every couple interdimansional trips you make. In 1.8, there is a chance that a trip to the nether will burn through memory. I once got up to 91% used memory (my computer somehow adjusted the allocated to 96% until I restarted, and then it went down to 50 again) before I noticed due to FPS rate and restarted minecraft.
     
  6. Shepard1707

    Shepard1707 This'll be fun.

    y'see, that's why, asside from Nether ruins, I intend to just fly everywhere.

    It's the safest way to travel.
     
  7. Soulgazer

    Soulgazer Dunno what to put here

    As long as you have a bunch of coal, don't type e into chat, and am able to make a landing and take off in terrain of varying height and short runway with a nonupdated model, yes:p.
     
  8. Shepard1707

    Shepard1707 This'll be fun.

    I suppose we can't all be aces like me. :p
     
  9. El_Shamro

    El_Shamro Master of...something...

    Flying's a lot easier if you just ignore the model and just watch how the world moves relative to you. It also helps to bring a map if you know where you want to land.
     
  10. Killah

    Killah BANNED :p

    Simply put, it tells your java implementation how much RAM to use at minimum, and how much to use at most.


    Technical details courtesy of manpages:
    Code:
    -Xmnsize or -XX:NewSize
                Sets the size of the young generation (nursery).
    
              -Xmsn
                Specify the initial size, in bytes, of the memory allocation
                pool. This value must be a multiple of 1024 greater than 1MB.
                Append the letter k or K to indicate kilobytes, or m or M to
                indicate megabytes. The default value is chosen at runtime based
                on system configuration. For more information, see HotSpot
                Ergonomics @
                http://docs.oracle.com/javase/7/docs/tech‐
                notes/guides/vm/gc-ergonomics.html
                Examples:
                        -Xms6291456
                        -Xms6144k
                        -Xms6m
    
              -Xmxn
                Specify the maximum size, in bytes, of the memory allocation
                pool. This value must a multiple of 1024 greater than 2MB. Append
                the letter k or K to indicate kilobytes, or m or M to indicate
                megabytes. The default value is chosen at runtime based on system
                configuration. For more information, see HotSpot Ergonomics @
                http://docs.oracle.com/javase/7/docs/tech‐
                notes/guides/vm/gc-ergonomics.html
                Examples:
                        -Xmx83886080
                        -Xmx81920k
                        -Xmx80m
    
                On Solaris 7 and Solaris 8 SPARC platforms, the upper limit for
                this value is approximately 4000m minus overhead amounts. On
                Solaris 2.6 and x86 platforms, the upper limit is approximately
                2000m minus overhead amounts. On Linux platforms, the upper limit
                is approximately 2000m minus overhead amounts.
     
  11. Soulgazer

    Soulgazer Dunno what to put here

    Did you read the date?
     
  12. Killah

    Killah BANNED :p

    It's at the top of the forum, and it's being indexed by google.

    That means that at some point some poor bloke may google that exact question. And therefore I put an answer out, just to help anyone who found the page out.

    Before you yell thread necromancy though, it was on the front page of the forum, so it's not like I ruined anything for anyone, is it?
     
Thread Status:
This thread lies dormant for more than 14 days. Restarting it causes mods to gaze in your direction.

Share This Page