IIS Application Pool and .NET Garbage Collection

Consider an ASP.NET application with a connection pool memory leak problem (where connections, for example, do not close correctly).

Does the application pool recycle the pool connection pool (so more connections can be made)?

If the connections remain in memory until the garbage collector deletes them, will this happen when the application pool restarts (or can they leave them further)? I also understand that the garbage collector can clean them at any time, but are still in use and cannot be collected until restarting reset or application pool?

I am looking at a system in which the ultimate goal, obviously, is to correctly correct the code for proper connection management, and I am trying to get more information about the garbage collection / application process.

+3
source share
2 answers

Yes, disposing of the application pool kills and restarts the IIS process responsible for starting your application. All resources are freed at this stage simply because the process ends.

, . , , , . Dispose() ( "" ), , , .

+4

- . - ( ) . , , ; .

Close Dispose , . , , . , , , . Dispose - using, Dispose .

ADO.NET 2.0 : ClearAllPools ClearPool. , .

+1

Source: https://habr.com/ru/post/1713026/


All Articles