Solve the error of Error:java: java.lang.OutOfMemoryError: WrappedJavaFileObject...GC overhead limit exceeded

1. Reproducing the error


When starting the project today, the following error was reported:

Insert image description here

Right nowError:java: java.lang.OutOfMemoryError: WrappedJavaFileObject[org.jetbrains.jps.javac.InputFileObject[file:xxx.java]]@pos242:@pos242: GC overhead limit exceeded

2. Analysis errors


Translate the error Error:java: java.lang.OutOfMemoryError: WrappedJavaFileObject[org.jetbrains.jps.javac.InputFileObject[file:xxx.java]]@pos242:@pos242: GC overhead limit exceededinto Chinese, as shown below:

Insert image description here

According to the translation results, GCthe overhead limit is exceeded, that is, there is insufficient memory.

At the same time, according to this statement org.jetbrains.jps.javac.InputFileObject, this is jetbrainsan error reported, that is, ideaan error reported by my editor. The memory can be configured in the idea editor.

3. Solve the problem

  1. Use shortcut keys Ctrl + Alt + Sto open Settingsa panel:

Insert image description here

Of course, if your shortcut keys conflict, you can use them File --> Settings, as shown in the figure below:

Insert image description here

  1. turn upBuild,Execution,Deployment --> Complier

In Build process heap size (Mbytes):the corresponding text section, set a larger compilation memory. By default 700M, it can be gradually increased according to the actual situation.

I set a larger compilation memory to 1200, readers can set it according to the actual situation.

Insert image description here

Of course, some may be named Shared build process heap size (Mbytes):instead, Build process heap size (Mbytes):as shown in the figure below:

Insert image description here

  1. If the configuration is completed, it can be started successfully idea:

Insert image description here

Guess you like

Origin blog.csdn.net/lvoelife/article/details/133013097