You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MCP Server] 1.4.16 leaks millions of Windows handles, causing severe memory pressure #15132
NuGet.Mcp.Server 1.4.16 accumulated millions of handles during a long-running VS Code Copilot SDK Agent Host session. Memory usage reached 96% on a 32 GB Windows machine and fell to 64% after disabling and terminating the servers, without rebooting.
Environment
Windows 11 Pro x64, build 26300; 31.49 GiB physical RAM
One Copilot runtime started two server instances about 11 minutes apart. Several hours later, each had:
~4.82 million handles
~2.7 GiB private memory (up from ~1 GiB earlier)
498 additional handles over 10 seconds, consuming ~5.5 CPU seconds
Machine-wide kernel pools reached ~22.7 GiB paged and ~7 GiB nonpaged. After termination, paged pool visibly declined, including ~0.5 GiB reclaimed in 20 seconds. Process records temporarily remained with zero handles and one thread during cleanup; overall RAM usage subsequently fell from 96% to 64%.
Expected / investigation needed
Handle and memory usage should remain bounded. This was observed in a real development session; no minimal reproduction or handle-type/pool-tag attribution was captured. We did not invoke NuGet MCP tools during the investigation.
Recovery strongly implicates the server or its dependencies, but not every kernel allocation has been attributed to it. Please investigate per-instance handle growth; the host retaining two instances may be a separate VS Code/Copilot lifecycle issue.
Latest status report: The NuGet MCP server has 15.6 million handles and uses 6.8 GB of private memory. Windows also has 33.2 GB allocated to kernel pools—consistent with a severe handle leak.
@grantericstrong were you able to reproduce this issue on a solution with single class library project? You can create a nuget.config file for that solution using dotnet new nugetconfig command.
This was a multi-project solution and I have the C# Dev Kit in VS Code. I had multiple Windows open and multiple agent conversations in parallel. I'm not sure that was the problem. This kept reoccurring. I disabled the experimental setting in VS Code related to the NuGet MCP server but it started up again anyway. Possible from the Copilot runtime? Every time it is running it would consume all the memory it could and continuously burn CPU. I disabled the MCP server globally and it at least doesn't start now.
Thanks for the detailed report. We tried to reproduce this on Windows build 26300 with 1.4.16 and haven't seen any growth yet. We tested launch via dotnet tool execute on SDK 10.0.401, idle sessions, parallel and cancelled tool calls against a 13-project CPM solution, an unreachable telemetry endpoint, and abrupt host disconnects. All stayed under ~900 handles, and CPU returned to zero when idle.
If it happens again, could you capture the following from the growing process before killing it? Run everything from an elevated prompt.
Which process is growing. Please send the image path and parent of the process. The process whose command line contains NuGet.Mcp.Server@1.4.16 is the dotnet.exe launcher, not the server itself:
Also, if you can, dotnet-dump collect -p <pid>. The dump may contain file paths or source URLs, so please share it privately.
Whether the host is still sending requests. Please check for active Copilot agent conversations at that moment. If possible, include the MCP output log from VS Code (Output panel → MCP: nuget) for that time window.
Your environment. Please include any authenticated or private feeds, credential providers installed, and whether the solution uses MSBuild SDKs from NuGet (for example Microsoft.Build.Traversal) or workloads.
Setting DOTNET_CLI_TELEMETRY_OPTOUT=1 for the server and checking whether growth still occurs would also help isolate the telemetry exporter.
Activity
dotnet-policy-service commentedon Nov 2, 2026
Issue is missing Type label, remember to add a Type label
grantericstrong commentedon Nov 7, 2026
Latest status report: The NuGet MCP server has 15.6 million handles and uses 6.8 GB of private memory. Windows also has 33.2 GB allocated to kernel pools—consistent with a severe handle leak.
This seems severe? Or am I doing something wrong?
kartheekp-ms commentedon Nov 10, 2026
@grantericstrong were you able to reproduce this issue on a solution with single class library project? You can create a nuget.config file for that solution using
dotnet new nugetconfigcommand.grantericstrong commentedon Nov 10, 2026
This was a multi-project solution and I have the C# Dev Kit in VS Code. I had multiple Windows open and multiple agent conversations in parallel. I'm not sure that was the problem. This kept reoccurring. I disabled the experimental setting in VS Code related to the NuGet MCP server but it started up again anyway. Possible from the Copilot runtime? Every time it is running it would consume all the memory it could and continuously burn CPU. I disabled the MCP server globally and it at least doesn't start now.
jeffkl commentedon Nov 23, 2026
Thanks for the detailed report. We tried to reproduce this on Windows build 26300 with 1.4.16 and haven't seen any growth yet. We tested launch via
dotnet tool executeon SDK 10.0.401, idle sessions, parallel and cancelled tool calls against a 13-project CPM solution, an unreachable telemetry endpoint, and abrupt host disconnects. All stayed under ~900 handles, and CPU returned to zero when idle.If it happens again, could you capture the following from the growing process before killing it? Run everything from an elevated prompt.
NuGet.Mcp.Server@1.4.16is thedotnet.exelauncher, not the server itself:handle.exe -s -p <pid>, taken twice about 60 seconds apart.dotnet-dump collect -p <pid>. The dump may contain file paths or source URLs, so please share it privately.Microsoft.Build.Traversal) or workloads.Setting
DOTNET_CLI_TELEMETRY_OPTOUT=1for the server and checking whether growth still occurs would also help isolate the telemetry exporter.