Could not reserve enough space for object heap

Published by DARKNINJA on
Issue description

This is the error I get when I try to recompile or launch Minecraft test environment.

Executing gradle command: cleanCache clean setupDecompWorkspace --refresh-dependencies
Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\cijinmathew\Desktop\GM\MCreator174>cd forge
C:\Users\cijinmathew\Desktop\GM\MCreator174\forge>SET "JAVA_HOME=C:\Users\cijinmathew\Desktop\GM\MCreator174\jdk32\"
C:\Users\cijinmathew\Desktop\GM\MCreator174\forge>SET JAVA_EXE=%JAVA_HOME%\bin\java.exe
C:\Users\cijinmathew\Desktop\GM\MCreator174\forge>SET PATH=%JAVA_HOME%\bin\;%PATH%
C:\Users\cijinmathew\Desktop\GM\MCreator174\forge>gradlew -Dorg.gradle.jvmargs="-Xms512m -Xmx1024m" cleanCache clean setupDecompWorkspace --refresh-dependencies
#################################################
         ForgeGradle 2.2-SNAPSHOT-d13a6c8        
  https://github.com/MinecraftForge/ForgeGradle  
#################################################
               Powered by MCP unknown               
             http://modcoderpack.com             
         by: Searge, ProfMobius, Fesh0r,         
         R4wk, ZeuX, IngisKahn, bspkrs           
#################################################
:cleanCache
:clean
:deobfCompileDummyTask
:deobfProvidedDummyTask
:getVersionJson
:extractUserdev
:extractDependencyATs SKIPPED
:extractMcpData
:extractMcpMappings
:genSrgs
:downloadClient
:downloadServer
:splitServerJar
:mergeJars
:deobfMcSRG
Applying SpecialSource...
Applying Exceptor...
:decompileMc
Error occurred during initialization of VM
Could not reserve enough space for 3145728KB object heap
:decompileMc FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':decompileMc'.
> Process 'command 'C:\Users\cijinmathew\Desktop\GM\MCreator174\jdk32\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4 mins 3.189 secs
C:\Users\cijinmathew\Desktop\GM\MCreator174\forge>
Task completed with return code 0 in 248151 milliseconds

   

Issue comments

You did not assign enough RAM to MCreator. Add more RAM to MCreator from the preferences menu.

If you are using the 32-bit version, consider using 64-bit version instead as you will have a hard time with only 4GB of RAM and using MCreator. This is also noted in the recommended specifications so this issue is closed as works as designed.

On 64-bit computers, you should always use the 64-bit version. Check this issue for more details: https://mcreator.net/tracker/issue/40598

You might fix the bug by reducing the amount of RAM by doing as suggested in the linked issue, but if this does not help, you can't do much.

Minecraft decompilation requires a lot of RAM and the required amount get bigger with each Minecraft update.

You will have to update computer which should be done in any case because 32-bit technology is very outdated. Most likely, you have 64-bit compatible processor but for unknown reason 32 bit OS. In such case, consider installing 64-bit Windows which is wise in all aspects, not only for MCreator.