Huge memory consumption by running dotnet even with just a -? switch
See original GitHub issueIssue Description
When I type just dotnet -?
or dotnet build -?
, it makes huge memory consumption. the machine is Win7, the .NET is the latest.
here is a nicey screenshot, screwed up a bit by jpg though:
of 8GBs of RAM almost all is consumed, even though performance monitor shows 1 or 2 dotnet instances, each having around 600MB commit, but significantly smaller working sets (380KB of a private set, when running just dotnet -?
). especially for the 2nd one. still, it gets noticeable, that the system pages out a lot, other programs lag after this (black rectangles on screen instead of their client areas). the disk is 5400rpm, not NVMe SSD.
Steps to Reproduce
just typing dotnet [build] -?
or biulding a simple “hello world” in the specified below environment is enough to reproduce it.
Analysis
when running dotnet. both from CLI and VS. no more ideas.
looking at the screenshot, it’s seen, that the amount increases (for several seconds duration), by 4GB. even though, the dotnet process commit is ~500MB. as said, the working set (any) is way smaller. if that is just a confusion of the counters, why other programs experience the lag, very well observable on the GUI? I don’t know if modified time on the pagefile is an accurate measure of paging happened, but while posting this and making the screenshot, the pagefile modified time remained with 6 hours ago.
Versions & Configurations
>msbuild -version
MSBuild version 17.4.1+9a89d02ff for .NET Framework
17.4.1.60106
dotnet CLI and VS IDE. the latest VS (downloaded yesterday). Windows 7 x64.
Regression?
I don’t know, since I am a C guy and always have been using MSVC and nmake from command line.
Issue Analytics
- State:
- Created 8 months ago
- Comments:7 (3 by maintainers)
It would work but I would recommend you to add it to each repository for consistency among all its developers.
MSBuild 17.4 runs on .NET 7. You should add a
global.json
file to your repository limiting the SDK version to 6.