gpt4 book ai didi

java - Maven spotbugs 插件因内存不足错误而失败

转载 作者:行者123 更新时间:2023-11-29 08:31:36 29 4
gpt4 key购买 nike

我正在尝试像下面这样使用 spotbugs-maven-plugin

<build>
...
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.0-RC8</version>
<configuration>
<plugins>
<plugin>
<groupId>jp.skypencil.findbugs.slf4j<groupId>
<artifactId>bug-pattern</artifactId>
<version>1.2.4</version>
</plugin>
</plugins>
<includeFilterFile>./spotbugIncludeFilter.xml</includeFilterFile>
<onlyAnalyze>com.vnera.-</onlyAnalyze>
<argLine>-Xmx1024m</argLine>
</configuration>
</plugin>
</build>

但每次都失败并出现以下错误

[INFO] Fork Value is true
[java] Out of memory
[java] Total memory: 482M
[java] free memory: 43M

堆栈跟踪如下所示

[java]  at java.util.ArrayList.<init>(ArrayList.java:152)
[java] at edu.umd.cs.findbugs.ba.Frame.<init>(Frame.java:113)
[java] at edu.umd.cs.findbugs.ba.vna.ValueNumberFrame.<init>(ValueNumberFrame.java:90)
[java] at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:181)
[java] at edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysis.createFact(ValueNumberAnalysis.java:58)
[java] at edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis.lookupOrCreateFact(BasicAbstractDataflowAnalysis.java:185)
[java] at edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis.getStartFact(BasicAbstractDataflowAnalysis.java:70)
[java] at edu.umd.cs.findbugs.ba.Dataflow.execute(Dataflow.java:234)
[java] at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:76)
[java] at edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory.analyze(ValueNumberDataflowFactory.java:46)
[java] at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.analyzeMethod(AnalysisCache.java:369)
[java] at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getMethodAnalysis(AnalysisCache.java:322)
[java] at edu.umd.cs.findbugs.ba.ClassContext.getMethodAnalysis(ClassContext.java:1005)
[java] at edu.umd.cs.findbugs.ba.ClassContext.getValueNumberDataflow(ClassContext.java:336)
[java] at edu.umd.cs.findbugs.detect.FindInconsistentSync2.analyzeMethod(FindInconsistentSync2.java:638)
[java] at edu.umd.cs.findbugs.detect.FindInconsistentSync2.visitClassContext(FindInconsistentSync2.java:413)
[java] at edu.umd.cs.findbugs.DetectorToDetector2Adapter.visitClass(DetectorToDetector2Adapter.java:76)
[java] at edu.umd.cs.findbugs.FindBugs2.analyzeApplication(FindBugs2.java:1079)
[java] at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:280)
[java] at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:401)
[java] at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1187)

我也试过设置 <argLine>-XX:MaxPermSize=1024m</argLine> .仍然遇到同样的错误。

谁能告诉我如何解决这个问题?

  • Java 8
  • maven 3

最佳答案

你看过maxHeap了吗? ?这应该有助于解决您的内存问题。

同样来自他们的 FAQ它指出:

You can increase this using the -maxHeap n option, where n is the number of megabytes of heap space to allocate.

关于java - Maven spotbugs 插件因内存不足错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47682227/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com