Why does my very simple C# program leak 890MB of RAM?
I'm writing a very simple C# application that downloads dummy data from URLs to test internet speed, I thought i'd make a proof of concept. But unfortunately the program leaks RAM in Release mode
Any ideas?
3 Replies
I have found a solution, instead of using httpClient.GetAsync(url), I should've been using httpClient.GetStreamAsync(url)
i suggest using the same http client for every request too. you dont want to keep allocating new sockets
Use IHttpClientFactory to reuse your HttpClient objects.