Hi @Kundan Pitroda ,
Welcome to Microsoft Q&A! Thanks for posting the question.
I understand that you are using ApplicationInsights to monitor your multi-threaded console application. I was not able to gather the target .NET framework from the Exception shared, but the following information is common to both .NET core and .NET framework.
1. Regarding the usage of TelemetryClient
in console application, we don't recommend creating multiple TelemetryClient
instances in the application. A singleton instance is registered in DependenecyInjection container and you should get the instance of TelemetryClient
by using constructor injection or by using serviceProvider.GetRequiredService<TelemetryClient>();
. For more details, please refer to Application Insights for Console Application.
2. Memory leak - It is not possible to state that you are running into memory leak scenario only by looking at one of the exceptions. You may or maynot be running into memory leak. A memory leak generally happens when your app references objects that it no longer needs to perform the desired task, which causes memory to be not claimed efficiently through garbage collection. I would suggest referring to the following links for details on how to diagnose and troubleshoot memory leak scenarios:
>. Measure memory usage in Visual Studio
>. Debug a memory leak in .NET Core
Please let me know if you have any questions.
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.