Android Studio Out of Memory Error(Java heap space)

Hello Folks,

If you have an error like this while running your Android Studio App project

Out of memory: Java heap space. Please assign more memory to Gradle in the project’s file. For example, the following line, in the file, sets the maximum Java heap size to 1,024 MB: org.gradle.jvmargs=-Xmx1024m

Then you should go to


And increase the maximum heap size like

org.gradle.jvmargs=-XX\:MaxHeapSize\=2024m -Xmx2024m

Then go to

File–>Invalidate Caches / Restart –> Invalidate and Restart

You should try it until you got the right heap size for you.

Have a nice coding… 🙂

“Android Studio Out of Memory Error(Java heap space)” için bir yanıt

  1. start the jvisualVM before you start the emulator, and you can see in the left side of jvisualVM s window the active processes, start then the emulator, you will see in JVM the emulator s process and open the monitor tab, you will see how much heap will allocate for the process. After your java android process crashes create a dump with JVM and then open that dump with MAT and investigate all the leaks. aurelius Dec 12 ’14 at 8:44

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir