##[error]ERROR: GC overhead limit exceeded - SonarQube in TFS Build

##[error]ERROR: GC overhead limit exceeded - SonarQube in TFS Build

我们是来自 TFS CI 任务的 运行 SonarQube。

一段时间前,当我手动触发构建时,SonarQube 分析取得了成功,但同一个构建给出了错误,现在我的用户也无法使用手动触发。

[error]ERROR: GC overhead limit exceeded

虽然自动触发,因为我们已经为不同的 TFS 用户配置了夜间计划构建

这就是我为 SONAR_SCANNER_OPTS 配置系统变量的方式,它在手动触发时工作正常

我已经检查了 this 文档,因为它似乎是用户权限问题。

用户权限:

而且,根据此 TFS 用户拥有生成管理员和项目管理员的访问权限,可以访问我定义的变量 SONAR_SCANNER_OPTS

只需在名为 SONAR_SCANNER_OPTS 的 VSTS 构建中设置一个值为 -Xmx8192m 的变量,然后再试一次。

请参阅 Dinesh 在类似问题中的评论:GC overhead limit exceeded using the VSTS task

Try to give more memory to the Run Code Analysis task rather than the Prepare analysis on SonarQube task.

Also both sonar.web.javaOpts and sonar.ce.javaOpts are server-side options for SonarQube operation. You do not need to worry about those as you are relying on SonarCloud. Setting those for an analysis during a build will have no effect. Just set SONAR_SCANNER_OPTS which as you saw in your deleted post does have an effect (i.e. setting it to 4096 bytes did lead to an immediate failure of the JVM)