mvn install 报 GC overhead limit exceeded

发布于 2022-09-11 23:56:59 字数 4881 浏览 8 评论 0

错误信息:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:00 min
[INFO] Finished at: 2019-12-06T10:36:47+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] GC overhead limit exceeded -> [Help 1]
java.lang.OutOfMemoryError: GC overhead limit exceeded

at java.lang.String.substring (String.java:1969)
at java.util.StringTokenizer.nextToken (StringTokenizer.java:352)
at org.codehaus.plexus.util.MatchPattern.tokenizePathToString (MatchPattern.java:125)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:482)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)
at org.codehaus.plexus.util.DirectoryScanner.scandir (DirectoryScanner.java:496)

[ERROR]
[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/confl...

报错原因:
卡住在这一行,[INFO] Copying webapp resources [/Users/tok/HolyGrace/webapp]
很久,然后抛出了上述错误

.bash_profile配置如下:
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/h...
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/h...
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/tok/flutter-dev/flutter/bin:$PATH
export ANDROID_HOME=/Users/tok/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/tok/Library/Android/sdk
export ANDROID_AVD_HOME=/Users/tok/.android/avd
export PATH=${path}:/usr/local/Cellar/dart/2.3.2/bin
export PATH=$PATH:$MAVEN_HOME/bin
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export MAVEN_HOME=/Users/tok/apache-maven-3.6.0
M2_HOME=/Users/tan/apache-maven-3.6.0
PATH=$M2_HOME/bin:$PATH
export M2_HOME
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib
export JAVA_OPTS="-Xms56m -Xmx4048m -XX:PermSize=100M -XX:MaxPermSize=4048M -XX:-UseGCOverheadLimit"
export MAVEN_OPTS="-Xms56m -Xmx4048m -XX:PermSize=100M -XX:MaxPermSize=4048M -XX:-UseGCOverheadLimit"

~
截图:
image.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心房的律动 2022-09-18 23:56:59

maven消耗内存太多,超过配置的限定值,可以的话修改maven分配内存上限。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文