zsharp
zsharp

Reputation: 13766

When are ASP.NET MVC Controllers garbage collected?

Once a controller object is created when does it become available for garbage collection?

Upvotes: 1

Views: 2850

Answers (1)

Dimi Takis
Dimi Takis

Reputation: 4959

Usually when no active reference to this object is detected. This is handled internally by the garbage collector and so you do not have to take care about it.

So, having this in mind, after the moment Page_Unload method is called which is hosting the controller, the garbage collector gets notified that the controller object is ready for disposal.

Upvotes: 4

Related Questions