maven-resources-production:testing-service: java.lang.OutOfMemoryError: Java heap space

已回答

I can’t start the service through idea, but the jar file is launched through the console.

I changed the SDK several times in the project settings. The problem is not heap, but something else.

Executing pre-compile tasks… Running 'before' tasks Checking sources Finished, saving caches… maven-resources-production:testing-service: java.lang.OutOfMemoryError: Java heap space Executing post-compile tasks… Synchronizing output directories…

Executing pre-compile tasks…
Running 'before' tasks
Checking sources
Finished, saving caches…
maven-resources-production:testing-service: java.lang.OutOfMemoryError: Java heap space
Executing post-compile tasks…
Synchronizing output directories…
28.12.2023 19:37 - Build completed with 1 error and 0 warnings in 2 sec, 590 ms

0

Based on the output it looks like the build is being processed by IDEA's Native Build System. Does the problem persist if you trigger the build from the Maven Tool Window?

Also, check and try adjusting the following settings:

For IDEA Native Build System: SettingsBuild, Execution, Deployment → Compiler → Shared build process heap size

For Maven: SettingsBuild, Execution, Deployment → Build Tools → Maven → Runner → add an xmx option to VM Options field

Let me know if it helps!

0

Me and one other person in my project are having the exact same issue. 

Build via maven is running fine, build via IntelliJ results in an OutOfMemoryException instantly.

Ive tried incresing the “Shared build process heap size” significantly (700 → 2000, later to 5000), but it didnt change anything.

I also tried invalidating caches and restarting (with all options selected), but it didnt help.

Help → About:

IntelliJ IDEA 2023.3.2 (Ultimate Edition)
Build #IU-233.13135.103, built on December 20, 2023
Licensed to [...] / Jonas Eckstein
You have a perpetual fallback license for this version.
Subscription is active until December 31, 2024.
Runtime version: 17.0.9+7-b1087.9 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1970M
Cores: 8
Registry:
  debugger.new.tool.window.layout=true
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.github.lppedd.idea-conventional-commit (0.22.0)
  org.antlr.intellij.plugin (1.23)
  de.jonaseckstein.KubeSeal (0.2.1)
  org.jetbrains.plugins.go-template (233.11799.172)
  com.poratu.idea.plugins.tomcat (4.7.2)
  CheckStyle-IDEA (5.87.0)
  org.mapstruct.intellij (1.6.1)
  com.haulmont.jpab (2023.4.1-233)
  Pythonid (233.13135.103)
  izhangzhihao.rainbow.brackets (2024.2.1)
  zielu.gittoolbox (500.1.9+222)
  de.endrullis.idea.postfixtemplates (2.20.0.233)
Kotlin: 233.13135.103-IJ
0

Jonas Eckstein Based on the screenshot it looks like you are using IDEA's Native Build System.

Please try the following options:

Disable “Use Compiler From module target JDK when possible” option (Settings → Build, Execution, Deployment → Compiler → Java Compiler), if the issue persists try setting “Shared build process heap size” to 1400, specifically.

If the issue still persists, try adding -Dforked.javac.heap.size.mb=5000 to “Shared build process VM options” (Settings → Build, Execution, Deployment → Compiler → Java Compiler).

0

I had the same issue and after several rounds of tries and errors, this is what finally helped: Build > Build Project

 

4

Thanks.
This solved my issue.

0

请先登录再写评论。