Difference between revisions of "Fixing memory issues"
m (Some body moved page Fixing memory errors to Fixing memory issues without leaving a redirect) |
Lord Samosa (talk | contribs) (Updated seo) |
||
(44 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | One of the most common issues encountered when installing [[Pixelmon]] is | + | {{#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== | ||
+ | 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" | ||
− | |||
− | |||
*"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" | ||
− | If the crash begins with any of these lines, then ''Minecraft'' is crashing because it ran out of memory. | + | *"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=== | ===Freezing=== | ||
− | If ''Minecraft'' freezes on the loading screen, it is very likely that | + | *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== | ==Allocating more memory== | ||
− | [[File:JVMArguments.png|thumb|300px|The JVM | + | [[File:JVMArguments.png|thumb|300px|The vanilla JVM arguments section, with the <code>-Xmx2G</code> argument underlined.]] |
− | To | + | To improve performance and stability in a modded setup, more memory must be allocated to ''Minecraft''. (at least 2GB) |
− | # | + | |
− | # | + | ===''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]]. | ||
+ | |||
==Other problems== | ==Other problems== | ||
− | If ''Minecraft'' does not successfully start up after changing the | + | If ''Minecraft'' does not successfully start up after changing the allocation, there are several possible causes. |
− | ===32 | + | |
− | + | ===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 | + | Could not reserve enough space for ###KB object heap |
− | You can download | + | |
− | ===32 | + | 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. |
− | If you are using Windows and are unable to install a 64-bit Java version, it is possible that your operating system is 32 | + | |
− | + | 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. | |
− | 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 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: |
− | *[ | + | |
− | ===Insufficient | + | *[https://www.howtogeek.com/228042/how-to-switch-from-32-bit-windows-10-to-64-bit-windows-10/ Windows 10] |
− | [[File: | + | *[https://www.tomshardware.com/faq/id-1653310/upgrade-windows-bit-bit.html Windows 8] |
− | If you | + | *[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. | ||
+ | |||
+ | 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 [https://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 | + | 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. | ||
− | |||
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 | + | #In the "Environment Variables" window, scroll through the list labeled "System variables" until you find a variable labeled <code>_JAVA_OPTIONS</code>. |
− | #Select the | + | #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.
Contents
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
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
To improve performance and stability in a modded setup, more memory must be allocated to Minecraft. (at least 2GB)
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
-Xmx#M
or-Xmx#G
. Change this to-Xmx2G
.
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 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
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:
- 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 "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
. - Select the
_JAVA_OPTIONS
entry and click "Delete" to remove it. - Restart your computer.
- After Windows restarts, start up Minecraft to verify that it is now able to start successfully.