How do i allocate more ram/memory to minecraft?

#1JFaydPosted 10/6/2011 10:41:06 PM
Problem: Minecraft kicks me off every 10 seconds to the "saving chunks" screen then freezes and says minecraft has crashed.

Reason im asking the obvious: All the results from yahoo answers or related are "why would you want to do that" or extremely sarcastic things like "touch your pc with a fork" and stupid crap people post to be "clever" on those sites. Anyway, i just recieved a 3200 dollar PC in the mail and i can take over the damn world with this much power, but i cant play minecraft. Help please?
---
Join my guild..
#2G_TacoPosted 10/6/2011 10:50:34 PM(edited)
@ECHO OFF
java -Xmx1024M -Xms1024M -jar minecraft.exe

paste that into a text editor, save with the .bat extension, put it next to your minecraft.exe

basically makes a shortcut/alternate way to startup minecraft, but with more RAM

edit: assuming you are on Windows. But personally for me, the debug info (F3 while playing) tends to tell me I'm barely using the default memory allocated so I don't really need more.
#3JFayd(Topic Creator)Posted 10/6/2011 10:51:16 PM(edited)
considering ive only ever played in browser, ill try this, lets see what happens, did exactly what you said. lets.. try.


update: failed, crashed even faster.
#4LzyRobPosted 10/6/2011 10:51:06 PM
There's a way to do it via Control Panel -> Java

But I tried that last night on a laptop and I didn't notice any change whatsoever (However the topic to do it like that is located on the official minecraft forums in the "Tutorials" section if you are interested)

The way that works better for me is to create a batch file
Open Notepad and paste
javaw -Xmx768m -Xms256m -cp "%APPDATA%\.minecraft\bin\minecraft.jar;%APPDATA%\.minecraft\bin\jinput.jar;%APPDATA%\.minecraft\bin\lwjgl.jar;%APPDATA%\.minecraft\bin\lwjgl_util.jar" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft

Change the drop down box to "All Files" and save as a .bat extension

On the top line you see -Xmx768 -Xms256. Xmx### is the maximum allowed (in Megabytes) and Xms### is the initial amount allocated (Also in megabytes).

Figure out how much RAM you have. Open the taskmanager (ctrl+alt+delete) and see how much RAM you have free with all of your current processes/programs running. And then play around with the numbers you have left.

I have 2 gigs of RAM total, running at 41% physical memory usage. So that's why I put my max at 768MB (So I'm not using 100% of my total RAM at any given time) and the 256 I randomly put in and it seems to work perfectly.
Haven't had a single memory crash since.
---
Anytime something doesn't make sense.... A wizard did it!
MAC11 = OP ::: http://www.youtube.com/watch?v=I1ka4Zxj_a4
#5LzyRobPosted 10/6/2011 10:54:15 PM
Also, the reason why my post has more lines is because it includes the crash reporter too.
You can do what I said and play with the numbers that the second poster told you to while using his code, it's the same thing
---
Anytime something doesn't make sense.... A wizard did it!
MAC11 = OP ::: http://www.youtube.com/watch?v=I1ka4Zxj_a4
#6JFayd(Topic Creator)Posted 10/6/2011 10:54:47 PM
tried that too just now, crashed, and on top of that my skin went away and my achievments reset. tried the game again WITH OUT your way of doing it, my skin is back, unknown if anything else happened as of yet.
---
Join my guild..
#7G_TacoPosted 10/6/2011 10:55:12 PM
That's exactly how I do it and it works for me. Not that I really use it cause I don't need more memory according to f3.

Maybe the problem doesn't even have to do with RAM? Can you manage to press F3 and read the Used Memory and Allocated Memory in top right corner?
#8JFayd(Topic Creator)Posted 10/6/2011 10:57:49 PM
http://i56.tinypic.com/2vifhuf.png

there. no idea what any of it means.
---
Join my guild..
#9G_TacoPosted 10/6/2011 11:06:54 PM(edited)
Well according to that you are only using 141/989mb of your memory which is only 14% so it seems like it isn't really a memory problem.

edit: don't really know what to tell you, I haven't had any problems like that yet. Maybe try switching to peaceful mode in case there are like 500 ghasts secretly lagging you somewhere. Personally I've never seen a chunk update count that high, but I haven't seen that many screens so I dunno if its unusual. But that sounds like a lot of activity.
#10RossMcSaucePosted 10/6/2011 11:19:34 PM
This might be obvious, but just in case, make sure you have the 64 bit Java installed and not the 32 bit.
---
Blizzcon 2010 original Song Contest Entry - Hellscream's Warsong
http://www.youtube.com/watch?v=-kqXWPKtXqo