0

When starting a new project gradle sync fails, and the only solution That fix it is adding to gradle.properties file in the project the next line: org.gradle.jvmargs=-Xmx1024m

I know it allocates more memory than specified in the begining, my question is if there is a way of fixing it without making changes in the gradle file?Or where can I change it to permanently allocate 1024 without me adding it every time to the gradle file? TNX

1 Answers1

0

You are modifying the JVM args with that flag. To make more "permanent" modifications to your memory allocation, you should check Environment Variables. You should have a System Variable called _JAVA_OPTIONS with the value -Xms256m -Xmx512m. You can change it here, maybe to -Xms256m -Xmx1024m to increase the JVM max heap size accordingly.

Also see the answers here: Android Studio - How to increase Allocated Heap Size

Community
  • 1
  • 1
Jim
  • 10,172
  • 1
  • 27
  • 36