ApplicationInsights-dotnet
ApplicationInsights-dotnet copied to clipboard
Potential net6 App Insights Memory Leak
- List of NuGet packages and version that you are using: <PackageReference Include="Microsoft.ApplicationInsights" Version="2.19.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.19.0" />
- Runtime version (e.g. net461, net48, netcoreapp2.1, netcoreapp3.1, etc. You can find this information from the
*.csproj
file): net6 - Hosting environment (e.g. Azure Web App, App Service on Linux, Windows, Ubuntu, etc.): Azure Web App
Describe the bug
Created a net6 project hosted in Azure Web App to host a reasonably simple REST API. After running for about a day noticed extremely high memory usage akin to a memory leak application insights described in #1678 Was able to capture memory dump and find 26.5k long running net tasks seemingly coming from Microsoft.AI.PerfCounterCollector
Mitigated by using versions <PackageReference Include="Microsoft.ApplicationInsights" Version="2.11.0" /> <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.8.2" />
Hi @BPHartel Can you share a minimal repro? This would allow us to collect a dump to investigate.
I am also seeing this issue and it may prevent us from using App Insights
Was able to capture memory dump and find 26.5k long running net tasks seemingly coming from Microsoft.AI.PerfCounterCollector
26564
is the thread ID, not the number of threads.
I'm also seeing something similar while using Azure Functions, our App Service Plan memory usage slowly creeps up over time.
After talking with Azure support, they provided a system process graph showing "MeteringDotNetCore.dll" process with nearly 40% usage at the time of capture. The behavior suddenly started showing without any changes and suddenly stopped as well.
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.