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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.