The BDcraft forum has migrated.
You are currently browsing the Archived BDcraft Forum.
To post a new topic, comment or patch, let's go to the new forum: BDcraft Community Forums

Tutorial: Giving Minecraft more RAM

24 replies [Last post]
HanFox's picture
HanFox
Offline
I am Forum Lead ModeratorI released a major BDcraft patchI love galleriesI searched for an answer myselfThe Cake is a lieI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 16/04/2012

Giving Minecraft more RAM

A lot of the time the help given is to "give Minecraft more RAM" quite possibly followed by "Google it!", so I've decided to write a quick guide as to how to do that.

Note: When selecting your maximum RAM to give to Minecraft it can only be the max of what your system can handle AFTER taking in to account how much memory your Operating System requires. Typically the max will be 512MB to 1024MB less than your system's capacity.

Note 2: Keep in mind anything over 8192MB (8GB) would generally be considered too much for Minecraft as giving it more than it needs can actually make the game run less efficiently.

Windows

Spoiler: Highlight to view

1) The batch file

Open Notepad and place this code inside it:
start /high java -Xmx4096M -cp Minecraft.jar net.minecraft.LauncherFrame

Save the file with a filename such as run_minecraft.bat in the same place as your Minecraft.jar (alternatively you can change Minecraft.jar to Minecraft.exe if you prefer the exe.

Note: It's very important the filename ends in .bat and not .txt

What this does:
start /high java -> tells java to start with a high system priority (high priority is suggested by Optifine to reduce stutter, you can remove "/high" if you don't want it)
-Xmx4096M - Tells Java it can use UP TO 4096 megabytes of RAM
-cp Minecraft.jar net.minecraft.LauncherFrame - Tells Java to launch Minecraft

Note: There are hundreds of extra switches and tweaks that can go in the command line... Google it Winking

Preview: click to enlarge

2) A custom launcher

A custom launcher is exactly what it says. It's a launcher just like Minecraft normally has, but with a few extra tweaks.

The two that most readily come to mind are Magic Launcher and MultiMC.

Once downloaded both have a section that allows you to give Minecraft more RAM.



Magic Launcher

Click "Setup" > "Advanced" tab > Set "Memory" to desired maximum:
Preview: click to enlarge



MultiMC

Right click your instance > Select "Settings" from the menu > Click the "Java" tab > Set "Minimum memory allocation" and "Maximum memory allocation" to desired limit:
Preview: click to enlarge

3) Via the Control Panel

I don't recommend this way as it applies to every Java program you may run and may cause instability to other programs.

Go to Start Menu > Control Panel > Java.

In the Java Control Panel window select the "Java" tab and then click "View...".

In the following window you should see a window with a section that has "Runtime Parameters" here you can enter much the same as in the batch file section of the tutorial, e.g. -Xmx4096M

Click OK until all the windows are gone and then run Minecraft as normal.

Mac and *nix

Spoiler: Highlight to view
Technically all of the same ways as in Windows do exist on Mac and *nix, but I can't guarantee stability nor interoperability so it really only leaves...

Using a custom launcher


The two custom launchers that most readily come to mind are Magic Launcher and MultiMC.

Once downloaded both have a section that allows you to give Minecraft more RAM.



Magic Launcher

Click "Setup" > "Advanced" tab > Set "Memory" to desired maximum:
Preview: click to enlarge



MultiMC

Right click your instance > Select "Settings" from the menu > Click the "Java" tab > Set "Minimum memory allocation" and "Maximum memory allocation" to desired limit:
Preview: click to enlarge

Feed the Beast and Technic Launchers

Spoiler: Highlight to view
Most of the modpack launchers have a setting to change the RAM easily via a dropdown or slider.

Feed the Beast


Open the launcher > click Options > adjust the "RAM Maximum (MB)" slider:
Preview: click to enlarge

Technic


Open the launcher > click Options > adjust "Memory to allocate" dropdown:
Preview: click to enlarge Preview: click to enlarge

If anything is confusing or unclear let me know and I'll try to expand and possibly add screenshot guides.

Also, if you have other tips & tricks or ways to achieve giving Minecraft more RAM (especially stable ones for Mac and *nix) let me know!

Comments

Zakol's picture
Zakol
Offline
I searched for an answer myselfI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 18/03/2013

Helpful if you do not know how to Happy
Also, is that your skin? Tongue

HanFox's picture
HanFox
Offline
I am Forum Lead ModeratorI released a major BDcraft patchI love galleriesI searched for an answer myselfThe Cake is a lieI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 16/04/2012

[quote=Zakol]Helpful if you do not know how to Happy
Also, is that your skin? :P[/quote]
It's good that it's helpful Happy

Also, yes, that's my skin. I've been using it for years now and have had no desire to change it as I only play with my g/f and she doesn't mind looking at it Tongue

Zakol's picture
Zakol
Offline
I searched for an answer myselfI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 18/03/2013

[quote=HanFox][quote=Zakol]Helpful if you do not know how to Happy
Also, is that your skin? :P[/quote]
It's good that it's helpful Happy

Also, yes, that's my skin. I've been using it for years now and have had no desire to change it as I only play with my g/f and she doesn't mind looking at it :P[/quote]

Yeah, I actually used this tutorial, hence the helpful part.
Never thought of using magic launcher, but did.
And on the topic of skins, I had mine custom made by a friends older sister.
And she still hates me for making her re-color the pants 12 times Tongue

Shikozu's picture
Shikozu
Offline
I searched for an answer myself
Joined: 04/05/2013

Is there a maximum amount recommended? Or perhaps, a maximum amount that *can* be utilized?

I've often seen the statement that MC can't use more than 1gb of ram. I don't know if it's true or not. I've got 16g of ram on my machine, how much can I boost things?

Also, if I'm using Magic Launcher, and I up the amount of ram in it's settings, is that accomplishing the same thing as your tutorial?

Thanks for your patience Happy

HanFox's picture
HanFox
Offline
I am Forum Lead ModeratorI released a major BDcraft patchI love galleriesI searched for an answer myselfThe Cake is a lieI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 16/04/2012

Er... all of your questions are actually answered in my post... try reading it?

Shikozu's picture
Shikozu
Offline
I searched for an answer myself
Joined: 04/05/2013

I did read it, obviously I didn't understand it completely.

Which is of course a good reason for you to be rude.

HanFox's picture
HanFox
Offline
I am Forum Lead ModeratorI released a major BDcraft patchI love galleriesI searched for an answer myselfThe Cake is a lieI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 16/04/2012

I'm not being rude. I wrote it in the most simple English I could to avoid confusion, so it feels like you didn't really read it. The only way I can explain it is to basically restate it. So it's a little frustrating to try to come up with a more simplistic way to get it across.

[quote]Note: When selecting your maximum RAM to give to Minecraft it can only be the max of what your system can handle AFTER taking in to account how much memory your Operating System requires. Typically the max will be 512MB-1024MB less than your system's capacity.[/quote]

So, for you, 16GB - 1GB = 15GB. However, 15GB is overkill for MC. 8GB would be the general maximum (even then that's a lot).

The MagicLauncher section tells you to set the "Memory" to the maximum you want to allocate.

Shikozu's picture
Shikozu
Offline
I searched for an answer myself
Joined: 04/05/2013

Thank you for pointing out the 8MB max, I simply have been told "max 1024" so many times, I was confused if I was missing or misunderstanding something. I also wasn't entirely sure if giving extra ram to Magic Launcher was as good as your way, or if even I needed to make the allocation amount *match* in both MLauncher and Java.

It is good to know I can utilize more of my system. 1g out of 16g seemed a shame to waste.

Thank you for your tutorial.

HanFox's picture
HanFox
Offline
I am Forum Lead ModeratorI released a major BDcraft patchI love galleriesI searched for an answer myselfThe Cake is a lieI explored bdcraft websiteI like to comment everythingI love to post here
Joined: 16/04/2012

After some tweets by cpw today I have taken out any mention of Xms.

Apparently, if you have a min set that is different than the max Java is "aiming" to get the memory usage back down to the min value as opposed to it just going "well this is the lowest it can be". Which causes it to be aggressive and might cause lag spikes.

So it's best to either not set a min (or -Xms) where possible or make the min and max the same!

JackyDawg's picture
JackyDawg
Offline
Joined: 17/06/2013

I cant allocate more that 1GB of RAM in the tekkit launcher dropdown menu! Any way to use the 1st method to allocate more?