Saturday 4 March 2017

Managed vs Unmanaged resources

What's the difference between the two? well a managed resource can be thought of anything inside of your application, the catch is some of these managed resources say for example a database connection or a stream will use unmanaged resources, basically things your garbage collector wont know about.

You can think of unamanged resources as things that the garbage collector doesn't know how to collect. Whereas managed resources are things your garbage collector does know how to collect.

generally it's safe to say that you really shouldn't worry about managed resources, usually your garbage collector will "handle" them eventually, however there's nothing wrong with doing some house cleaning when you're objects are no longer needed.