Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Increasing Minecrafts RAM Usage


  • Please log in to reply
7 replies to this topic

#1

GriffonDefender

Posted 01 January 2012 - 06:15 PM

I am wondering how to increase the amount of RAM minecraft uses. I've tried many tutorials and none of them work. I have a 32 bit OS and JRE6. I don't want to have to update my Java, but if it's necessary, then I will. But if it's not, then please tell me how I can solve this dilemma.
P.S. I have premium now, so please don't say that it might be because I have cracked.
griffondefender.weebly.com
Minecraft mods, texture packs, and more!

Register or log in to remove.

#2

Syfaro
    Syfaro

    Retired Guru

  • Retired Staff
  • 5209 posts
  • Minecraft: Syfaro

Posted 01 January 2012 - 06:19 PM

http://dl.dropbox.co...M_Allocator.jar

Run this on your desktop or something, then just use run.bat to use that much RAM.

Minecraft API - A JSON API for fetching information about Minecraft & Minecraft servers

Read my blog about tech stuff!


#3

Bakugo
    Bakugo

    Void Walker

  • Members
  • 1686 posts
  • Location: Hollow Shades
  • Minecraft: bakugo

Posted 01 January 2012 - 06:46 PM

Here.

If you want to change how mutch RAM it uses (default is 2gb, or 2048mb), right click the batch file, click 'Edit', find a line that says
java -Xincgc -Xmx2048M -cp Minecraft.exe net.minecraft.LauncherFrame
and replace
-Xmx2048M
with
-Xmx<ammount of RAM in MB>M
or
-Xmx<ammound of RAM in GB>G

Posted Image


#4

Syfaro
    Syfaro

    Retired Guru

  • Retired Staff
  • 5209 posts
  • Minecraft: Syfaro

Posted 01 January 2012 - 06:49 PM

View Postbakugo, on 01 January 2012 - 06:46 PM, said:

Here.

If you want to change how mutch RAM it uses (default is 2gb, or 2048mb), right click the batch file, click 'Edit', find a line that says
java -Xincgc -Xmx2048M -cp Minecraft.exe net.minecraft.LauncherFrame
and replace
-Xmx2048M
with
-Xmx<ammount of RAM in MB>M
or
-Xmx<ammound of RAM in GB>G

I have to say, my way is a bit easier. It does all the configuration for you, all you have to do is choose an amount and click enter.

Minecraft API - A JSON API for fetching information about Minecraft & Minecraft servers

Read my blog about tech stuff!


#5

Bakugo
    Bakugo

    Void Walker

  • Members
  • 1686 posts
  • Location: Hollow Shades
  • Minecraft: bakugo

Posted 01 January 2012 - 07:22 PM

View PostBadW0lf, on 01 January 2012 - 06:49 PM, said:

I have to say, my way is a bit easier. It does all the configuration for you, all you have to do is choose an amount and click enter.

I can also do that, but i just had this one in my dropbox, because so many people ask for these.

Posted Image


#6

CODsniperkid

Posted 01 January 2012 - 07:44 PM

View Postbakugo, on 01 January 2012 - 07:22 PM, said:

I can also do that, but i just had this one in my dropbox, because so many people ask for these.

Well that and considering Bakugo gave us the code, we know it's virus free. You gave us a file, which I am testing with AV right now. Good news. Trend says it's virus free, but here are the results of Virustotal.com.

Spoiler:

Quote

The only stupid question is the question you don't ask. ~GB_Implicit

#7

Syfaro
    Syfaro

    Retired Guru

  • Retired Staff
  • 5209 posts
  • Minecraft: Syfaro

Posted 01 January 2012 - 10:53 PM

View PostCODsniperkid, on 01 January 2012 - 07:44 PM, said:

Well that and considering Bakugo gave us the code, we know it's virus free. You gave us a file, which I am testing with AV right now. Good news. Trend says it's virus free, but here are the results of Virustotal.com.

Spoiler:

Here's the entire source code, if you want it.

package badw0lf.mcram;

import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.ReadableByteChannel;

/**
 *
 * @author Greg
 */
public class MinecraftRAMAllocator {

	/**
	 * @param args the command line arguments
	 * @throws IOException  
	 */
	public static void main(String[] args) throws IOException {
		URL mc = new URL("https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar");
		ReadableByteChannel rbc = Channels.newChannel(mc.openStream());
		String app = System.getenv("APPDATA") + "/.minecraft/";
		FileOutputStream fox = new FileOutputStream(app + "minecraft.jar");
		fox.getChannel().transferFrom(rbc, 0, 1 << 24);
		main.main(null);
	}
}

package badw0lf.mcram;

/**
 *
 * @author Greg
 */
public class a extends javax.swing.JFrame {

	/**
	 * Creates new form a
	 */
	public a() {
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated Code">						  
	private void initComponents() {

		jLabel1 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();
		jLabel5 = new javax.swing.JLabel();
		jLabel6 = new javax.swing.JLabel();
		jLabel7 = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jLabel1.setText("Run file generated!");

		jButton1.setText("Bye!");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});

		jLabel5.setText("Just open Minecraft with the");

		jLabel6.setText("run.bat file now in the folder!");

		jLabel7.setText("(you can move this file)");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(layout.createSequentialGroup()
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
					.addGroup(layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jLabel1))
					.addGroup(layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jLabel5))
					.addGroup(layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jLabel6))
					.addGroup(layout.createSequentialGroup()
						.addContainerGap()
						.addComponent(jLabel7))
					.addGroup(layout.createSequentialGroup()
						.addGap(46, 46, 46)
						.addComponent(jButton1)))
				.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		layout.setVerticalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(layout.createSequentialGroup()
				.addContainerGap()
				.addComponent(jLabel1)
				.addGap(18, 18, 18)
				.addComponent(jLabel5)
				.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(jLabel6)
				.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(jLabel7)
				.addGap(18, 18, 18)
				.addComponent(jButton1)
				.addContainerGap(23, Short.MAX_VALUE))
		);

		pack();
	}// </editor-fold>						

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {										 
		System.exit(0);
	}										

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		/*
		 * Set the Nimbus look and feel
		 */
		//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
		/*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		}
		//</editor-fold>

		/*
		 * Create and display the form
		 */
		java.awt.EventQueue.invokeLater(new Runnable() {

			public void run() {
				new a().setVisible(true);
			}
		});
	}
	// Variables declaration - do not modify					 
	private javax.swing.JButton jButton1;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	// End of variables declaration				   
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package badw0lf.mcram;

import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Greg
 */
public class main extends javax.swing.JFrame {
	private static final long serialVersionUID = 1L;

	/**
	 * Creates new form main
	 */
	public main() {
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed" desc="Generated Code">						  
	private void initComponents() {

		jLabel1 = new javax.swing.JLabel();
		RAM = new javax.swing.JComboBox();
		jLabel2 = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

		jLabel1.setText("How Much RAM?");

		RAM.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1024 (1GB)", "2048 (2GB)", "4096 (4GB)", "8192 (8GB)" }));

		jLabel2.setText("Please note that you");

		jLabel3.setText("must have at least 1GB more RAM than you choose");

		jButton1.setText("Enter");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
				.addContainerGap(59, Short.MAX_VALUE)
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
					.addComponent(jLabel3)
					.addGroup(layout.createSequentialGroup()
						.addGap(65, 65, 65)
						.addComponent(jLabel2)))
				.addGap(77, 77, 77))
			.addGroup(layout.createSequentialGroup()
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
					.addGroup(layout.createSequentialGroup()
						.addGap(128, 128, 128)
						.addComponent(RAM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
						.addGap(46, 46, 46)
						.addComponent(jButton1))
					.addGroup(layout.createSequentialGroup()
						.addGap(145, 145, 145)
						.addComponent(jLabel1)))
				.addContainerGap())
		);
		layout.setVerticalGroup(
			layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
			.addGroup(layout.createSequentialGroup()
				.addGap(37, 37, 37)
				.addComponent(jLabel1)
				.addGap(18, 18, 18)
				.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
					.addComponent(RAM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
					.addComponent(jButton1))
				.addGap(26, 26, 26)
				.addComponent(jLabel2)
				.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
				.addComponent(jLabel3)
				.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);

		pack();
	}// </editor-fold>						

	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {										 
		try {
			String a = null;
			String b = null;
			String r = (String)RAM.getSelectedItem();
			switch (r) {
				case "1024 (1GB)":
					a = "1G";
					b = "512M";
					break;
				case "2048 (2GB)":
					a = "2G";
					b = "1G";
					break;
				case "4096 (4GB)":
					a = "4G";
					b = "2G";
					break;
				case "8192 (8GB)":
					a = "8G";
					b = "4G";
					break;
			}
			String write = "@ECHO OFF" + System.getProperty("line.separator") + "javaw -jar -Xmx" + a + " -Xms" + b + " minecraft.jar";
			File file = new File("run.bat");
			try (Writer output = new BufferedWriter(new FileWriter(file))) {
				output.write(write);
			}
		} catch (IOException ex) {
			Logger.getLogger(main.class.getName()).log(Level.SEVERE, null, ex);
		}
		dispose();
		a.main(null);
	}										

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		/*
		 * Set the Nimbus look and feel
		 */
		//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
		/*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		}
		//</editor-fold>

		/*
		 * Create and display the form
		 */
		java.awt.EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				new main().setVisible(true);
			}
		});
	}
	// Variables declaration - do not modify					 
	private javax.swing.JComboBox RAM;
	private javax.swing.JButton jButton1;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	// End of variables declaration				   
}

Minecraft API - A JSON API for fetching information about Minecraft & Minecraft servers

Read my blog about tech stuff!


#8

GriffonDefender

Posted 02 January 2012 - 05:26 PM

Thanks guys. I'm going to have to say that bakugos was actually easier, but when the time comes when I am able to run my mods, I'll make sure that you both get proper recognition, along with CODsniperkid and others who have helped me along the way.
griffondefender.weebly.com
Minecraft mods, texture packs, and more!