This sounds a little strange, but I'm not sure if my process has a memory leak or not, and I was hoping to get some information.
Recently, I was assigned an investigation into the reasons why the Windows service in production consumed about one drum (the server it runs on has 8 gigs). This is outside my experience as a developer, but for me there is a very good chance to find out how the garbage collector works in msdn and other sources. But at the moment I am very confused / when / the collection really works, for this reason, the article Iโve ever read is unclear.
1) I found a specific operation that increases the memory by 30 kb each time it is executed. 2) I went through the code very carefully and I think that I close everything correctly and delete links 3) I used several memory profiles, all of them seem to indicate that my old objects are related to gc. 4) If I leave the process completely inactive for several days, memory usage will suddenly drop to ~ 8 megabytes
Therefore, based on this, I am not even sure that I have a memory leak. Given that the GC is an expensive process, is it possible that I grew up to 1 gigabyte in production just because there was still a free ram and its purchase was โcheaperโ than launching the GC? Especially considering that this service is launched ~ 6 times per second? If so, what options do I have? I understand that I canโt force GC to start, do I have some kind of resort?
Thanks for any input you have, I understand that csharp's memory and gc leaks are a deep topic, and if it would be especially useful to read this topic, I would also be happy to point this way.
source share