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
请先登录再写评论。
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: Settings → Build, Execution, Deployment → Compiler → Shared build process heap size
For Maven: Settings → Build, Execution, Deployment → Build Tools → Maven → Runner → add an
xmx
option toVM Options
fieldLet me know if it helps!
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:
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).I had the same issue and after several rounds of tries and errors, this is what finally helped:
Build > Build Project
Thanks.
This solved my issue.
Hi ,
Shared build process heap size to
1400
, is nothing but normal Heap size right?I could not find the 2 and 3 parameters (Shared build process VM options, Shared build process heap size)
Due to my code changes I got OOM issues, after that If I try to run any other test its failling with same issue.
Tried to increase the heap size, terminate intellij, restart mac , reclone repository, reinstall intellij but no result.
Could you please help to resolve this
During my trials with the aforementioned suggestions regarding heap I read a warning in the Settings and switched of “Clear output directory on rebuild”, which helped me for now.
Marie Thanks issue solved by Build > Build Project
Marie thanks! Helped
https://intellij-support.jetbrains.com/hc/en-us/community/posts/16048531997586/comments/18076793744402