Possible Duplicates:
Garbage collection of static members
Will Garbage collector cleans up static methods and static class
Possible Duplicates:
Garbage collection of static members
Will Garbage collector cleans up static methods and static class
Methods and classes are not cleaned up. Objects are.
If you have a static reference to an object, the object in question will be cleaned up once the static goes out of scope (i.e. when the AppDomain is unloaded).
As far as I know that happens when the AppDomain is collected (which is when your application is closed).
No. Static classes will not be removed until you application domain is closed.
If you are refering static fields then no, there is no need. They by definition remain until the end of the process (or AppDomain).
If you are refering to local variable allocated by code in the static method then yes heap allocated memory will be tidied up by the GC
duplicate: http://stackoverflow.com/questions/851370/garbage-collection-of-static-members
Also I can mention, when OBJECT will be collected. Method's and classes will not be collected.
public class TestClass
{
public static Hashtable h_object = new Hashtable();
}
TestClass.h_object = null;
//* here it has no more references and it will be added to GC.
static means that there is just one object of this type. best example is the main method. it exist just once. so the garbage collection will collect those objects, too but not within a programm automatically, just at the end.
except of that what Lukas Šalkauskas said with "some_object"."some_other_obj" = null;