Out of memory? How to allocate more RAM to Java

General minecraft related topics
User avatar
RevStoningpot
Moron
Posts: 2477
Joined: Sat Aug 13, 2011 12:39 pm
Location: first star to the right and straight on till morning
Contact:

Out of memory? How to allocate more RAM to Java

Post by RevStoningpot »

Make a shortcut for your minecraft launcher. Right click the shortcut and go to properties. In the text box for target write:

Code: Select all

 "C:\Program Files\Java\jre6\bin\javaw.exe" -Xmx1200M -Xms1200M -jar "C:\Documents and Settings\User\Desktop\Minecraft.exe"
Note that ths isn't exactly what you may need to write.
The first target is for your javaw.exe file it's most likly as writen.
The 1200M is how many megabytes of RAM to allocae to java. You may need to check how much ram you have to know how much you can allocate. If it's too big minecraft won't run at all. If you still get out of memeory problems it probably needs more.
The last target is for your minecraft launcher file. The example is typical for a launcher on the desktop. User would be whatever your user folder is named. And the launcher may be minecraft.exe or minecraft.jar

Linux
1. Put minecraft launcher (minecraft.jar) in the home folder
2. Make a text file that reads:

Code: Select all

java -Xmx1024M -Xms1024M -jar /home/stoningpot/Minecraft.jar
of coarse stoningpot being your own user name
3. Set text file as executable in it's properties
4. Execute the text file. Does not need to be in same folder since i used the whole path
Last edited by RevStoningpot on Sun Mar 30, 2014 3:57 pm, edited 2 times in total.
dpy
OP
Posts: 190
Joined: Sat Aug 13, 2011 6:46 pm

Re: Out of memory? How to allocate more RAM to Java

Post by dpy »

And, for us OS X users:
1. Open "Java Preferences" (via Spotlight or Applications>Utilities)
2. Select the Java version at the top of the list on the "General' tab, then click "Options..."
3. Enter "-Xmx3072M -Xms3072M" into the "Runtime parameters" field, replacing 3072 with the amount of RAM you want to use.

Image
Xestia
OP
Posts: 292
Joined: Sat Sep 10, 2011 9:27 am

Re: Out of memory? How to allocate more RAM to Java

Post by Xestia »

Heh, this forum's more useful than minecraft forum
trouble_355
[rawr]
Posts: 31
Joined: Thu Nov 10, 2011 6:17 pm

Re: Out of memory? How to allocate more RAM to Java

Post by trouble_355 »

if you are using a 64bit os/pc but using 32bit java you will get oom crashes a lot so updating to 64bit java will solve that.
User avatar
RevStoningpot
Moron
Posts: 2477
Joined: Sat Aug 13, 2011 12:39 pm
Location: first star to the right and straight on till morning
Contact:

Re: Out of memory? How to allocate more RAM to Java

Post by RevStoningpot »

I can't figure out how to do this with ubuntu any help?
mitte90
OP
Posts: 1200
Joined: Mon Sep 05, 2011 4:27 pm

Re: Out of memory? How to allocate more RAM to Java

Post by mitte90 »

http://ubuntuforums.org/showthread.php?t=1800579 same as windows but other file links
User avatar
Gingeronamission
in diamond armor
Posts: 346
Joined: Mon Dec 26, 2011 3:55 pm
Location: Behind you, probably.

Re: Out of memory? How to allocate more RAM to Java

Post by Gingeronamission »

I don't get any of this.
User avatar
RevStoningpot
Moron
Posts: 2477
Joined: Sat Aug 13, 2011 12:39 pm
Location: first star to the right and straight on till morning
Contact:

Re: Out of memory? How to allocate more RAM to Java

Post by RevStoningpot »

No good all i get is this and the other command listed there says can't access the jar file and yes i put in the proper location as described in the minecraft.jar properties. But even if it did work isn't there some way to make like a shortcut or batch file to run it without all the command typing?

Exception in thread "main" java.lang.NoClassDefFoundError: net/minecraft/LauncherFrame
Caused by: java.lang.ClassNotFoundException: net.minecraft.LauncherFrame
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: net.minecraft.LauncherFrame. Program will exit.
mitte90
OP
Posts: 1200
Joined: Mon Sep 05, 2011 4:27 pm

Re: Out of memory? How to allocate more RAM to Java

Post by mitte90 »

make a text file in the same folder as ur minecraft.jar launcher file. paste this "java -Xmx1024M -Xms512M -cp ./Minecraft.jar" go into the files properties and select executeble.
User avatar
RevStoningpot
Moron
Posts: 2477
Joined: Sat Aug 13, 2011 12:39 pm
Location: first star to the right and straight on till morning
Contact:

Re: Out of memory? How to allocate more RAM to Java

Post by RevStoningpot »

nothing seems to happen and is the . on ./minecraft a typo i tried both any how
Post Reply