Error with gradlew setupDecompWorkspace: Could not reserve enough space

1.2k views Asked by At

While attempting to run the command

gradlew setupDecompWorkspace

Cmd responds with the following:

: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:\Program Files\Java\jdk1.8.0_144\bin\java.exe'' 
finished with non-zero exit value 1

I already have the gradle.properties file set with

org.gradle.jvmargs=-Xmx1280M

which I know is working, since the command would immediately fail with the exact same error anyways. It doesn't seem like my memory limit is keeping throughout the whole process, and my computer has terribly low memory to work with. As far as I know, I do have the latest JDK that I can use.

I am currently running Win 7 on a 32 bit system.

1

There are 1 answers

0
Vampire On

The error message is pretty obvious I'd say: "Could not reserve enough space for 3145728KB object heap".

That build you are trying to run calls an external Java process that tries to allocate 3 GiB of RAM. This can have two causes. The first one would simply be that you do not have enough RAM in your box for that very RAM-hungry build (not a fault of Gradle but of the project that uses it). The second cause is, well, you are using a 32-bit OS. 32-bit OS cannot address more than 2 GiB or RAM in a single process, so 3 GiB simply is not possible. Well, this is not the full truth, for Windows there is a trick. You can boot with a 3gb switch to increase the possible RAM per process to 3 GiB. If you want to do that, Google for it. But actually the best would be you switch to a 64-bit OS. Noone should have any need to use a 32-bit OS these days.

Alternatively you can of course change that build to not try to allocate 3 GiB in that external process. But this might then fail due to too less RAM for the process of course.