Join our discord
In partnership with NodeCraft Logo NodeCraft


You are not logged in! Create an account or login to contribute! Log in here!

Difference between revisions of "Fixing memory issues"

From Pixelmon Wiki
(Updated seo)
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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.
+
{{#seo:
 +
|title=Fixing memory issues
 +
|title_mode=replace
 +
|keywords= pixelmon, minecraft mod, RAM, memory, Java, allocate, allocating, allocation, 1GB, lag, mod, mods, Technic, Minecraft, ATLauncher,
 +
AT, Launcher
 +
|description=A guide to diagnosing Pixelmon memory issues and fixing them.
 +
}}
 +
One of the most common issues encountered when installing [[Pixelmon]] is Minecraft running out of memory. Pixelmon has many large assets such as models, textures, and sounds, that require significantly more memory to load compared to vanilla ''Minecraft'' and many other mods. Not having enough memory will generally cause ''Minecraft'' to crash or freeze while loading, though it can also manifest as persistent stutter.
  
 
==Identifying the issue==
 
==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.
+
Memory issues are not the only cause of ''Minecraft'' not loading, though the issues listed below are often related to insufficient allocated memory.
 +
 
 
===Crashing===
 
===Crashing===
 
[[File:OutOfMemory.png|thumb|300px|The first part of a ''Minecraft'' crash report. The highlighted area indicates that ''Minecraft'' has run out of memory.]]
 
[[File:OutOfMemory.png|thumb|300px|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.
+
 
 +
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"
 
*"java.lang.OutOfMemoryError: Java heap space"
 
*"net.minecraftforge.fml.common.LoaderException: 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"
 
*"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)"
 
*"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.
+
 
 +
 
 +
If the crash begins with any of these lines, then ''Minecraft'' is likely crashing because it ran out of memory.
 +
 
 
===Freezing===
 
===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'' freezes on the loading screen, it is very likely that it has run out of memory. In particular, memory issues commonly cause the Forge loading screen to freeze while loading models and textures. (at the "Reloading — ModelManager" stage)
 +
*If ''Minecraft'' freezes at a regular interval and then unfreezes after, it is possible that ''Minecraft'' does not have enough memory to run smoothly.
  
===Pixelmon launcher===
+
==Allocating more memory==
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.
+
[[File:JVMArguments.png|thumb|300px|The vanilla JVM arguments section, with the <code>-Xmx2G</code> argument underlined.]]
*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 [[Fixing memory issues#Global Java options|this section]].
+
To improve performance and stability in a modded setup, more memory must be allocated to ''Minecraft''. (at least 2GB)
*If the Pixelmon launcher does not allow you to allocate more than 1200M of memory, see [[Fixing memory issues#32-bit Java|this section]].
+
 
 +
===''Minecraft'' launcher===
 +
#In the vanilla ''Minecraft'' launcher, select the "Launch options" tab.
 +
#*Make sure that the switch labeled "Advanced settings" is turned on!
 +
#Find and click the Forge profile that you are using to play Pixelmon.
 +
#Find the "JVM Arguments" text box, and then the text that reads <code>-Xmx#M</code> or <code>-Xmx#G</code>. Change this to <code>-Xmx2G</code>.
 +
 
 +
===Technic launcher===
 +
#In the [[Technic launcher]], click the gear icon with the "Launcher Options" label at the top right.
 +
#Click into the "JAVA SETTINGS" tab.
 +
#Click into the "Memory" box, and increase the allocation to at least 2GB.
 +
 
 +
=== AT Launcher ===
 +
#In the AT Launcher, click "Settings" to the right.
 +
#Click into the "Java/Minecraft" tab.
 +
#Click into the "Maximum Memory/Ram" box, and increase the allocation to at least 2GB.
 +
 
 +
 
 +
If you cannot increase memory above 1GB or the game now crashes, see [[Fixing memory issues#32-bit Java|this section]].
  
==Allocating more memory==
 
[[File:JVMArguments.png|thumb|300px|The JVM Arguments section of the profile editor. The "-Xmx2G" argument is underlined in blue.]]
 
To fix an issue with running out of memory, more memory must be allocated to ''Minecraft'' (at least 2G).
 
#On the ''Minecraft'' launcher, edit the profile that you are using to play Pixelmon.
 
#Under the "Java Settings (Advanced)" section, 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".
 
#Start ''Minecraft''. If it completes start-up successfully, you have allocated enough memory.
 
 
==Other problems==
 
==Other problems==
If ''Minecraft'' does not successfully start up after changing the JVM arguments, there are several possible causes.
+
If ''Minecraft'' does not successfully start up after changing the allocation, 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. One way to check this is to examine the ''Minecraft'' game output when ''Minecraft'' fails to start. If you have a 32-bit Java version, the following message will be displayed:
+
===32 bit Java===
 +
You may be using a 32 bit Java version, which will not allow allocations higher than roughly 1GB. If you have a 64 bit version of Java installed, it's still possible that ''Minecraft'' is using your 32 bit Java installation instead. A way to check the Java version being used by ''Minecraft'' is to examine the game output when it fails to start. If ''Minecraft'' is using a 32-bit Java version, the following message will be displayed:
 +
 
 
  Error occurred during initialization of VM
 
  Error occurred during initialization of VM
 
  Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
 
  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
+
  Could not reserve enough space for ###KB object heap
You can download the installer for a 64-bit version of Java [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html here]. Make sure to choose the version of Java that is labeled "Windows '''x64'''".
+
 
[[File:SelectJavaInstall.png|thumb|right|Selecting a Java installation on the Pixelmon launcher]]
+
On the [[Technic launcher]], you will not be able to allocate more than 1GB of RAM if you are using a 32-bit Java version. The AT Launcher will throw an error when being installed in a 32 bit environment.
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".
+
You can download 64 bit installers for Java [https://java.com/en/download/manual.jsp here]. Make sure to choose a version that is labeled as 64 bit, as any unlabeled installers will still be 32 bit.
*On Mac OS X, 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.
+
===32 bit operating system===
*On the ''Minecraft'' launcher, edit your profile, find the text box labeled "Executable", and check the checkbox next to the text box if it is not already checked. Then, replace the contents of the text box with the file path to the Java executable file. Save your profile after doing this.
+
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. 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:
*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.
+
 
 +
*[https://www.howtogeek.com/228042/how-to-switch-from-32-bit-windows-10-to-64-bit-windows-10/ Windows 10]
 +
*[https://www.tomshardware.com/faq/id-1653310/upgrade-windows-bit-bit.html Windows 8]
 +
*[https://www.microcenter.com/tech_center/article/2694/How_to_upgrade_from_32Bit_x86_to_64Bit_x64_Windows_7 Windows 7]
 +
 
 +
===32 bit hardware===
 +
If you cannot upgrade to a 64 bit operating system, it is possible that your computer's processor only supports 32 bit operation. In this case, you will need to get a new computer with a 64 bit processor.
 +
 
 +
===Insufficient memory===
 +
[[File:InsufficientRAM2.png|thumb|300px|The amount of memory installed on a Windows 7 machine. This system does not have enough memory to run Pixelmon.]]
 +
 
 +
If you've already installed a 64 bit Java version and are still getting the same errors as before, your computer may not have enough memory to run Pixelmon.  
  
===32-bit operating system===
+
You can check the amount of memory installed on your system by right-clicking "Computer" (Windows 7/8) or "This PC" (Windows 10) and choosing "Properties". Look for the "Installed memory (RAM)" entry under "System". If there is 2GB or less installed, you will need to add more memory to your computer in order to run Pixelmon.  
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:
 
*[http://www.howtogeek.com/228042/how-to-switch-from-32-bit-windows-10-to-64-bit-windows-10/ Windows 10]
 
*[http://www.tomshardware.com/faq/id-1653310/upgrade-windows-bit-bit.html Windows 8]
 
*[http://www.microcenter.com/tech_center/article/2694/How_to_upgrade_from_32Bit_x86_to_64Bit_x64_Windows_7 Windows 7]
 
  
===Insufficient RAM===
+
Should you want to buy and install more memory, the process is explained in detail [https://www.pcworld.com/article/2957195/components/how-to-install-new-memory-in-your-pc.html here].
[[File:InsufficientRAM.png|thumb|300px|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 [http://www.pcworld.com/article/2957195/components/how-to-install-new-memory-in-your-pc.html here].
 
  
 
===Global Java options===
 
===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.
+
Windows systems may have specific settings set that will limit the amount of memory that can be allocated to a Java program. Frequently, this limit is less than 2GB 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, find the line that starts with "JVM Flags", and look for <code>-Xmx</code> in this line. If you see multiple <code>-Xmx</code> 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 <code>-Xmx2G</code> and an additional <code>-Xmx512M</code> that the user did not manually add.
  
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'''
 
  JVM Flags: 5 total; ... -XX:MaxPermSize=128m '''-Xmx2G''' -Xms256M '''-Xmx512M'''
 +
 
To remove this global limit, follow these steps:
 
To remove this global limit, follow these steps:
 
#In File Explorer, right-click on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choose "Properties".
 
#In File Explorer, right-click on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choose "Properties".
 
#A window will open. In the sidebar on the left of this window, select "Advanced system settings".
 
#A window will open. In the sidebar on the left of this window, select "Advanced system settings".
 
#A "System Properties" window will open. Select the "Environment Variables" button at the bottom of this window.
 
#A "System Properties" window will open. Select the "Environment Variables" button at the bottom of this window.
#In the "Environment Variables" window, scroll through the list labeled "System variables" until you find a variable labeled "_JAVA_OPTIONS".
+
#In the "Environment Variables" window, scroll through the list labeled "System variables" until you find a variable labeled <code>_JAVA_OPTIONS</code>.
#Select the "_JAVA_OPTIONS" entry and click "Delete" to remove it.
+
#Select the <code>_JAVA_OPTIONS</code> entry and click "Delete" to remove it.
 
#Restart your computer.
 
#Restart your computer.
 
#After Windows restarts, start up ''Minecraft'' to verify that it is now able to start successfully.
 
#After Windows restarts, start up ''Minecraft'' to verify that it is now able to start successfully.

Latest revision as of 18:53, 5 August 2020

One of the most common issues encountered when installing Pixelmon is Minecraft running out of memory. Pixelmon has many large assets such as models, textures, and sounds, that require significantly more memory to load compared to vanilla Minecraft and many other mods. Not having enough memory will generally cause Minecraft to crash or freeze while loading, though it can also manifest as persistent stutter.

Identifying the issue

Memory issues are not the only cause of Minecraft not loading, though the issues listed below are often related to insufficient allocated memory.

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"
  • "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 likely crashing because it ran out of memory.

Freezing

  • If Minecraft freezes on the loading screen, it is very likely that it has run out of memory. In particular, memory issues commonly cause the Forge loading screen to freeze while loading models and textures. (at the "Reloading — ModelManager" stage)
  • If Minecraft freezes at a regular interval and then unfreezes after, it is possible that Minecraft does not have enough memory to run smoothly.

Allocating more memory

The vanilla JVM arguments section, with the -Xmx2G argument underlined.

To improve performance and stability in a modded setup, more memory must be allocated to Minecraft. (at least 2GB)

Minecraft launcher

  1. In the vanilla Minecraft launcher, select the "Launch options" tab.
    • Make sure that the switch labeled "Advanced settings" is turned on!
  2. Find and click the Forge profile that you are using to play Pixelmon.
  3. Find the "JVM Arguments" text box, and then the text that reads -Xmx#M or -Xmx#G. Change this to -Xmx2G.

Technic launcher

  1. In the Technic launcher, click the gear icon with the "Launcher Options" label at the top right.
  2. Click into the "JAVA SETTINGS" tab.
  3. Click into the "Memory" box, and increase the allocation to at least 2GB.

AT Launcher

  1. In the AT Launcher, click "Settings" to the right.
  2. Click into the "Java/Minecraft" tab.
  3. Click into the "Maximum Memory/Ram" box, and increase the allocation to at least 2GB.


If you cannot increase memory above 1GB or the game now crashes, see this section.

Other problems

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

32 bit Java

You may be using a 32 bit Java version, which will not allow allocations higher than roughly 1GB. If you have a 64 bit version of Java installed, it's still possible that Minecraft is using your 32 bit Java installation instead. A way to check the Java version being used by Minecraft is to examine the game output when it 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 ###KB object heap

On the Technic launcher, you will not be able to allocate more than 1GB of RAM if you are using a 32-bit Java version. The AT Launcher will throw an error when being installed in a 32 bit environment.

You can download 64 bit installers for Java here. Make sure to choose a version that is labeled as 64 bit, as any unlabeled installers will still be 32 bit.

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. 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 hardware

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

Insufficient memory

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

If you've already installed a 64 bit Java version and are still getting the same errors as before, your computer may not have enough memory to run Pixelmon.

You can check the amount of memory installed on your system by right-clicking "Computer" (Windows 7/8) or "This PC" (Windows 10) and choosing "Properties". Look for the "Installed memory (RAM)" entry under "System". If there is 2GB or less installed, you will need to add more memory to your computer in order to run Pixelmon.

Should you want to buy and install more memory, the process is explained in detail here.

Global Java options

Windows systems may have specific settings set that will limit the amount of memory that can be allocated to a Java program. Frequently, this limit is less than 2GB 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, 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.

© 2012 - 2025 Pixelmon Mod