Java Eclipse Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

Java Eclipse Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
针对Eclipse 出现的内存溢出
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
解决方案:
点击Run->Run Configuration 弹出对话框图2

图1:如下
Java Eclipse Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

图2:如下
Java Eclipse Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

在对应左侧的Java Application 将要运行的main 方法类名,点击右侧Argument zai VM arguments 输入:输入 -Xmx800m, 保存运行。
大小自己定。

上述方法可以解决内存溢出。