I know that the static objects in .Net managed world are loaded in Loader Heap which is never going to be garbage collected.
What happens to the instance reference parameters passed to a static methods. Are they get garbage collected once the static function executed completely Or they are going to live forever as those instance reference variables are once passed to static method?
I am really confused this evening; Please guide me.
Thanks and regards
123Developer.
Yes, they are garbage collected after the static function is executed. You are creating objects in a non-static context, therefore they are not created in the loader heap. Just passing the reference to a static function doesnt change anything at all.