OK, then again. This is a difficult problem detecting memory leaks. First, make some entries, presumably for each request you requested β and write down the amount of memory used. Then find all your tasks β and the possible parts of the code that may generate leaks (if they are not executed during each request), as well as register their beginning and end.
When you do this, you can subsequently check your logs and search for parts in which memory usage is greatly increased, and then maybe you can determine how much of your code is leaking.
Another thing is that you can look for βmemory leaks that you useβ that you use - these are some of the mechanisms that you use, whatever they are.
On the other hand, there are a number of things that you must do to avoid memory leaks, the first of which comes to my mind, exploring the using() statement.
A. Do not think that you will find a problem in the next 20 minutes. This will take several days (when trying to debug with logging)
source share