A couple things wrong here:
This is not nearly enough to run the compilation process.
(x86) means you are likely running 32-Bit Java which will not let you use more than 2G, while the decompilation process is recommended to be run with 3G, which is specified in the gradle.properties that comes with the MDK, it is also recommended to run 64-Bit Java in general if you have a 64-Bit machine.