-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential memory leak of DiagnosticListener #1867
Comments
@forik I reviewed the trace and could see a possible leak. Could you please help with the following data.
Based on my initial research, Azure based back-end call may be contributing to this issue and wanted to understand from the data. It would also help if you have a repro for this issue so that I could recreate an issue and collect data. |
@rajkumar-rangaraj Below are data not from the exact timings. This one after one hour work after deploy: This one after two hours after previous query: Regarding to repro, it is not an easy task though, but I'll try to do my best. |
@forik I created a sample project to send/retrieve data from service bus. But I could not recreate this issue. In my scenario IndividualDiagnosticSourceListener object count always stays at 1. Below snapshot is the growth of objects for your app from the GC dump. |
@rajkumar-rangaraj could you please share the project so I could add the patterns we use with service bus? Probably we are doing something wrong |
Please sync and make sure both are testing the same version of ServiceBus SDK, and DIagnosticSource nuget version as well. |
@cijothomas @rajkumar-rangaraj I'm using Microsoft.Azure.ServiceBus 4.1.3 and I don't explicit dependency on System.Diagnostics.DiagnosticSource, so I guess it comes as a transitive dependency |
Any update on this issue ? We encounter the same issue in .Net Core 3.1(.8) .. |
@peterbomers Hi Peter, |
@Rayzbam thank you for the information. |
@Rayzbam We also fixed it with a singleton instance but now I'm a little bit concerned about all other Azure services. |
@peterbomers I'm glad it helped you ! TL;DR : Before using an Azure service, just be sure you know how to use it.. |
any updates? have the same with DataLake |
This is indeed a bug, we do recommend keeping clients as singletons (https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) but for some instances, it's impractical (e.g. BlobClient). Azure/azure-sdk-for-net#18199 is tracking the work to fix the bug. Because this component is shared between Azure SDKs as a source every individual SDK would need to update to get a fix. I suspect for most of them it would happen at the beginning of February. |
This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Creating a separate issue per suggestion from #1678
Describe your environment. Describe any aspect of your environment relevant to the problem:
What is the expected behavior?
GC able to reclaim memory
What is the actual behavior?
Number of DiagnosticSubscriptions grows in time without decreases.
Additional context.
After updating to 2.14 from 2.13.1 situation became better, but still DiagnosticSubscriptions count grows constantly. Included output from dotnet-gcdump is for approximately 12 hour period.
dumps.zip
The text was updated successfully, but these errors were encountered: