增加 Eclipse 的堆空间

BON*_*PIE 2 eclipse ram

我在 16.04 上使用 Eclipse,对于某些程序,它给出了以下消息:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Run Code Online (Sandbox Code Playgroud)

如何增加分配的堆空间?

小智 5

如果您需要为 Eclipse 本身增加堆空间,请在 Eclipse 安装目录中查找eclipse.ini文件并更改值-Xmx1024m。例如,您可以使用-Xmx2048m.