Currently I have a web service (WCF) that exposes methods that are set to static.
From a strictly memory/GC perspective, what is different in how the CLR and GC handle static versus non-static objects?
Currently I have a web service (WCF) that exposes methods that are set to static.
From a strictly memory/GC perspective, what is different in how the CLR and GC handle static versus non-static objects?
Static data won't be garbage-collected until the containing AppDomain is shut down; commonly this means the memory will stay allocated until the app is shut down, unless you're doing some kind of special AppDomain management. Non-static objects will be collected by the garbage collector, by the normal rules - no more references, and whenever the GC runs.