When I run my project ,error comes.
Starting process 'command 'C:\Java\jdk1.7.0\bin\java.exe''. Working directory: C:\Users\john\AndroidStudioProjects\Prefs\app Command: C:\Java\jdk1.7.0\bin\java.exe -Djava.awt.headless=true -Xmx1024M -Dfile.encoding=UTF-8 -Duser.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\john\AppData\Local\Android\sdk1\build-tools\21.1.2\lib\dx.jar com.android.dx.command.Main --dex --verbose --output C:\Users\john\AndroidStudioProjects\Prefs\app\build\intermediates\pre-dexed\debug\com.android.support-support-v4-21.0.3_42a7fe41e85c69c43b7a4dd1dda945656e9dd165.jar C:\Users\john\AndroidStudioProjects\Prefs\app\build\intermediates\exploded-aar\com.android.support\support-v4\21.0.3\jars\classes.jar
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.Error: A fatal exception has occurred. Program will exit.:app:transformClassesWithDexForDebug FAILED:app:transformClassesWithDexForDebug (Thread[Daemon worker Thread 8,5,main])completed. Took 0.549 secs.
I set .gradel.properties and gradle can be rebuilt and cleaned
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=128m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
In C:\User\john\.gradle\daemon\2.8\gradle.properties I set
org.gradle.jvmargs=-Xms256m -Xmx512m
Environment
os:windows7 RAM:4G JVM:1.7 android studio 1.5
Why the command of 'java.exe -Xmx1024m' is run.When I change this command to "-Xmx512m" and run in the command line ,this command was execute successfully.
How reduce the jvm in this command. I search the issue in SO much times buy not solve the question. Please help me ,thanks a lot.