简体   繁体   English

运行cl.exe时,VS2015的多处理器编译产生“没有足够的配额来处理此命令”

[英]Multi processor compilation of VS2015 produces “not enough quota is available to process this command” when running cl.exe

We are running automated Jenkins builds on Amazon servers (Windows Server 2012 R2) for a few Visual Studio solutions. 我们正在Amazon服务器(Windows Server 2012 R2)上运行针对某些Visual Studio解决方案的自动Jenkins构建。 The bigger projects in them are configured with the /MP , use multi processor compilation, attempting to minimize build time. 它们中较大的项目使用/MP进行配置,使用多处理器编译,以尽量减少构建时间。

We run msbuild with its /m flag as well. 我们也运行带有/m标志的msbuild

Problem is that after a few minutes we get: 问题是几分钟后我们得到:

TRACKER : error TRK0002: Failed to execute command: ""C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\CL.exe" @C:\\Users\\Administrator\\AppData\\Local\\Temp\\tmpd19a7e5e426f4ec7baa597ed75516fd4.rsp". 跟踪器:错误TRK0002:无法执行命令:“” C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ VC \\ bin \\ CL.exe“ @C:\\ Users \\ Administrator \\ AppData \\ Local \\ Temp \\ tmpd19a7e5e426f4ec7baa597ed75516fd4。 rsp”。 Not enough quota is available to process this command. 没有足够的配额来处理此命令。

This problem occurs only when running Jenkins agent. 仅在运行Jenkins代理时才会出现此问题。 With Visual Studio IDE everything is fine. 使用Visual Studio IDE,一切都很好。 When running MSBuild from command prompt everything is fine as well. 从命令提示符运行MSBuild时,一切都很好。

Any idea why that happens and we can work around it? 知道为什么会发生这种情况,我们可以解决它吗?

Running 跑步

WMIC CPU Get DeviceID,NumberOfCores,NumberOfLogicalProcessors
got
DeviceID  NumberOfCores  NumberOfLogicalProcessors
CPU0      2              4

Maybe VS2015 does not detect the number of effective processors correctly and crosses some process boundary of spawning too many processes concurrently? 也许VS2015无法正确检测到有效处理器的数量,并越过并发生成太多进程的某个进程边界?

Any help would be greatly appreciated. 任何帮助将不胜感激。

问题是在WinRM中定义了配额,如下所示: https ://msdn.microsoft.com/en-us/library/ee309367(v=vs.85).aspx我们将MaxProcessesPerShell的值更改为大于默认值为25,瞧。

The facile answer from technet to "create more virtual memory" is actually probably worth a bash. 来自technet的“创建更多虚拟内存”的简单答案实际上可能值得一ash。

Jenkins, at the time it launches MSBuild appears to use Runtime.exec() (checkout Launcher.java if you're having a look at their code). Jenkins在启动MSBuild时似乎使用Runtime.exec() (如果要查看它们的代码,请签出Launcher.java )。

This typically creates a new process, that, at least initially, has the same memory footprint as the launching process. 这通常会创建一个新进程,至少在开始时,该进程与启动进程具有相同的内存占用量。 So for a bit of time you're probably running twice as much memory as necessary for the build process. 因此,在一段时间内,您可能正在运行的内存是构建过程所需的两倍。 So having some more virtual memory available at launch time may be enough to allow the new process to run long enough for the launching process to finish and free. 因此,在启动时拥有更多的虚拟内存可能足以使新进程运行足够长的时间,以使启动进程完成并释放。

Here's Technet's cough useful description of the error message: https://technet.microsoft.com/en-us/library/cc958981.aspx 这是Technet对错误消息的咳嗽有用的描述: https : //technet.microsoft.com/zh-cn/library/cc958981.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM