MSBuild requires 3 times Visual Studio memory for clean build

We have a Visual Studio 2005 solution with 50 projects (mainly class libraries and some Win Form projects).

Performing a clean debug build using just started loading Visual Studio's peak memory (recorded by the task manager) shows about 500 MB.

Performing the same assembly (clean, debug) using MSBuild, the maximum memory is about 1600 MB, and as a result it will end with the exception of OutOfMemory.

This is the command I execute:

MSBuild LargeProject.sln / target: clean; build / nologo / property: Configuration = debug / verbosity: minimum

Both were running on the same PC that has Windows XP Professional 32bit with 2 GB of physical RAM.

I found this article an MSDN article describing the differences between building in Visual Studio and MSBuild, but does not explain why the assembly requires 3 times the memory.

Does anyone know why this is happening? And if there is something I can do to reduce MSBuild's memory requirements.

+3
source share
1 answer

I removed the project from the Visual Studio solution that was referenced by almost all other projects. Then the projects were changed to refer to the project dll instead of the project. This reduced MSBuild memory usage from 1600 MB to 1200 MB (400 MB difference) and was successful.

5 , dug 40kb 28kb. 3 Microsoft.VisualBasic.Compatibility, System System.Windows.Forms.

, , MSBuild - OutOfMemory.

0

Source: https://habr.com/ru/post/1714445/


All Articles