How to deal with “java.lang.OutOfMemoryError: Java heap space” error?

后端 未结 21 1774
死守一世寂寞
死守一世寂寞 2020-11-21 04:49

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryEr

21条回答
  •  青春惊慌失措
    2020-11-21 05:22

    In android studio add/change this line at the end of gradle.properties (Global Properties):

    ...
    org.gradle.jvmargs=-XX\:MaxHeapSize\=1024m -Xmx1024m 
    

    if it doesn't work you can retry with bigger than 1024 heap size.

提交回复
热议问题