Fixing memory issues

One of the most common issues encountered when installing Pixelmon is the user's system running out of memory (RAM). Pixelmon has many large assets, such as models, textures, and music, that require significantly more memory to load compared to vanilla Minecraft and most other mods, and not having enough memory will cause Minecraft to either crash or freeze while loading.

Contents

Identifying the issue

Memory issues are not the only cause of Minecraft not loading. Before attempting to fix a memory issue, it must first be confirmed that a memory issue is causing the problem.

Crashing

The first part of a Minecraft crash report. The highlighted area indicates that Minecraft has run out of memory.

If Minecraft crashes when attempting to start up, it is possible that the crash is caused by running out of memory. To check whether this is the case, you will need to look at the crash report that is displayed after Minecraft crashes. The first line of the crash report after "Description" is the start of the actual crash. Look for any of the following lines.

  • "java.lang.OutOfMemoryError: Java heap space"
  • "net.minecraftforge.fml.common.LoaderException: java.lang.OutOfMemoryError: Java heap space"
  • "net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: com/pixelmonmod/pixelmon/..."
  • "SplashProgress has detected a error loading Minecraft."
  • "Caused by: java.lang.IllegalAccessError: tried to access field net.minecraft.client.renderer.entity.RenderManager.field_178636_l from class com.pixelmonmod.pixelmon.client.ClientProxy"
  • "at net.minecraft.world.World.getSkyColorBody(World.java:1477)"

If the crash begins with any of these lines, then Minecraft is crashing because it ran out of memory.

Freezing

  • If Minecraft freezes on the loading screen, it is very likely that Minecraft has run out of memory. In particular, memory issues commonly cause the Forge loading screen to freeze while loading models and textures ("Reloading — ModelManager").
  • If Minecraft lags severely during gameplay, it is possible that Minecraft doesn't have enough memory to run smoothly.

Pixelmon launcher

The Pixelmon launcher will not allow you start up Minecraft until at least 2G of memory is allocated. While this restriction usually prevents memory issues from occurring, there are certain situations that may still cause memory issues.

  • If you have already allocated at least 2G of memory through the Pixelmon launcher and Minecraft still crashes or freezes due to memory issues (as detailed above), see this section.
  • If the Pixelmon launcher does not allow you to allocate more than 1200M of memory, see this section.

Allocating more memory

The JVM Arguments section of the profile editor. The -Xmx2G argument is underlined.

To fix an issue with running out of memory, more memory must be allocated to Minecraft (at least 2G).

Minecraft launcher

  1. On the Minecraft launcher, select the "Launch options" tab. Make sure that the switch labeled "Advanced settings" is turned on.
  2. Find and edit the profile that you are using to play Pixelmon.
  3. Find the "JVM Arguments" text box. Inside this text box, find the text that reads -Xmx. After this text, there will be a number and a letter; e.g., -Xmx1G or -Xmx512M. Change this to -Xmx2G.
  4. Start Minecraft. If it completes start-up successfully, you have allocated enough memory.

Pixelmon launcher

The Pixelmon launcher settings
  1. On the main screen of the Pixelmon launcher, locate the gear icon in the top-right corner of the launcher and click on it.
  2. Find the slider labeled "Maximum memory (MB)", and increase its value to at least 2G.
    • If you cannot increase this value more than 1200M, see this section.

Server

  1. Locate the command that you use to start your server. Depending on how you set up your server, this command may inside an executable file (e.g., a .bat or .command file), or the command may be directly entered into the command line.
  2. Within this command, find the text that reads -Xmx. After this text, there will be a number and a letter; e.g., -Xmx1G or -Xmx512M. Change this to -Xmx2G.
    • If you don't see any text that reads -Xmx, add -Xmx2G directly after java, separated on both sides by spaces. For example:
    java -Xmx2G -jar minecraft_server.jar nogui
    
  3. Start the server.

Other problems

If Minecraft does not successfully start up after changing the JVM arguments, there are several possible causes.

32-bit Java

If you are using Windows, you may be using a 32-bit Java version, which cannot allocate the needed 2G of memory needed to run Pixelmon. If you have a 64-bit version of Java installed, it's still possible that Minecraft is using your 32-bit Java installation instead of your 64-bit one. A way to check the Java version being used by Minecraft is to examine the Minecraft game output when Minecraft fails to start. If Minecraft is using a 32-bit Java version, the following message will be displayed:

Error occurred during initialization of VM
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Could not reserve enough space for <number>KB object heap

On the Pixelmon launcher, you will not be able to allocate more than 1200M of RAM if you are using a 32-bit Java version.

You can download the installer for a 64-bit version of Java here. Make sure to choose the version of Java that is labeled "Windows x64".

Selecting a Java installation on the Pixelmon launcher

After running the Java installer and installing the 64-bit Java version, find the file path to the Java executable file that was just installed.

  • On Windows, the default file path where Java is installed is C:\Program Files\Java\jdk1.8.0_<version>\bin\java.exe.
  • On macOS, the default file path where Java is installed is /Library/Java/JavaVirtualMachines/jdk1.8.0_<version>.jdk/Contents/Home/bin/java.

Once you have found the file path to the Java executable file, you will need to configure Minecraft to use this file. This will allow Minecraft to use the new Java version you have installed.

  • On the Minecraft launcher, edit your profile, find the text box labeled "Java executable", and enable it if it is not already enabled. Then, replace the contents of the text box with the file path to the Java executable file. Save your profile after doing this.
  • On the Pixelmon launcher, click the gear in the top-right corner of the launcher to open the launcher settings. Click on Select Java Install and browse your file system to find the Java executable file. Then, click "Continue" to save your settings changes.

32-bit operating system

If you are using Windows and are unable to install a 64-bit Java version, it is possible that your operating system is 32-bit and cannot run 64-bit programs. You can also check the initial crash report before you attempted to change the JVM arguments. In the "System Details" section at the bottom of the crash report, look for a line starting with Operating System. If it contains (x86), your operating system is 32-bit; you will need to upgrade to a 64-bit operating system in order to play Pixelmon. Below is an example of a 32-bit operating system:

Operating System: Windows 10 (x86) version 10.0

Be warned that upgrading Windows from 32-bit to 64-bit is not a trivial task. If you are willing to upgrade, see one of the following links depending on the version of Windows you are using:

32-bit CPU

If you cannot upgrade to a 64-bit operating system, it is possible that your computer's CPU hardware is 32-bit. In this case, you will need to get a new computer with a 64-bit CPU.

Insufficient RAM

The indicator of the amount of RAM installed on a Windows 7 machine. This system does not have enough RAM to run Pixelmon.

If you have already installed a 64-bit Java version and you're still getting the same error as before, then your computer may not have enough RAM to run Pixelmon. Check the amount of RAM on your system by right-clicking on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choosing "Properties". Look for the "Installed memory (RAM)" entry under "System". If you have 2.00 GB RAM or less installed, you will need to install more RAM on your system in order to run Pixelmon. This will require you to physically buy more RAM and insert it into your computer; details about this process can be found here.

Global Java options

Windows systems have a feature that limits the amount of memory that can be allocated to a Java program. Frequently, this limit is less than 2G of memory and will override any manually defined JVM arguments, causing too little memory to be allocated to Minecraft. To check if this limit is affecting you, look at the "System Details" section of the Minecraft crash report, and find the line that starts with "JVM Flags", and look for -Xmx in this line. If you see multiple -Xmx arguments, including one that is not in the "JVM Arguments" text box in your Minecraft profile, the global Java limit is preventing you from allocating enough memory.

The following snippet is an example of the JVM flags that are displayed in a crash report when the global Java limit problem occurs. Notice that there is a user-defined -Xmx2G and an additional -Xmx512M that the user did not manually add.

JVM Flags: 5 total; ... -XX:MaxPermSize=128m -Xmx2G -Xms256M -Xmx512M

To remove this global limit, follow these steps:

  1. In File Explorer, right-click on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choose "Properties".
  2. A window will open. In the sidebar on the left of this window, select "Advanced system settings".
  3. A "System Properties" window will open. Select the "Environment Variables" button at the bottom of this window.
  4. In the "Environment Variables" window, scroll through the list labeled "System variables" until you find a variable labeled _JAVA_OPTIONS.
  5. Select the _JAVA_OPTIONS entry and click "Delete" to remove it.
  6. Restart your computer.
  7. After Windows restarts, start up Minecraft to verify that it is now able to start successfully.