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

后端 未结 21 1734
死守一世寂寞
死守一世寂寞 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:25

    VM arguments worked for me in eclipse. If you are using eclipse version 3.4, do the following

    go to Run --> Run Configurations --> then select the project under maven build --> then select the tab "JRE" --> then enter -Xmx1024m.

    Alternatively you could do Run --> Run Configurations --> select the "JRE" tab --> then enter -Xmx1024m

    This should increase the memory heap for all the builds/projects. The above memory size is 1 GB. You can optimize the way you want.

提交回复
热议问题