9

when i'm running ionic build android --release i get an error

Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

Does anyone know the fix ?enter image description here

Amit Singh
  • 1,790
  • 3
  • 17
  • 27
  • no sure this might help : you can configure heap size in vm settings .. try that .. http://stackoverflow.com/questions/2294268/how-can-i-increase-the-jvm-memory – 10101010 Nov 02 '16 at 16:43
  • uninstall existing 32 bit JDK. this JDK by default installed in program files x86. now download (https://edelivery.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/jdk-8u191-windows-x64.exe) and install 64 bit. by default it will install in program files. that's it – user10845448 Dec 29 '18 at 06:16

3 Answers3

65

I got the solution by adding a new system variable name : _JAVA_OPTIONS and value : -Xmx512M

Amit Singh
  • 1,790
  • 3
  • 17
  • 27
6

After changing the setting in the environment you should restart your Command Prompt CMD to update environment variables

Mohsin A.
  • 98
  • 1
  • 5
0

your solution: I got the solution by adding a new system variable name : _JAVA_OPTIONS and value : -Xmx512M Hi Amit where should I change this