🌆 内容速览
- 🌕 报错信息
- 🌕 解决办法
🌕 报错信息
通过maven打包语句:mvn clean package -DskipTests -Ddockerfile.build.skip -Ptest -T 12 打包的时候出现报错java.lang.OutOfMemoryError: Java heap space,分析是打包时的默认内存大小分配过少,需要修改内存大小
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:40 min (Wall Clock)
[INFO] Finished at: 2024-04-10T09:55:09+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Java heap space -> [Help 1]
[ERROR] java.lang.OutOfMemoryError: Java heap space
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/OutOfMemoryError
Process finished with exit code 1
🌕 解决办法
IDEA找到 FIile - Settings - Build,Execution,Deployment - Build Tools - Maven - Runner,然后在右侧 VM Options 加入内存配置参数 -Xms512m -Xmx1024m
然后重新打包即可成功
最后最后祝愿大家,一辈子不要再见到一个bug!!!