SO question is that when and where memory gets allocated for static member variable in non-static class?is this variable also in heap and its dallocations also taken care by garbage collector?
1 Answer
The storage location is an implementation detail, but usually it should be on the Heap. Static variables are considered GC roots, so they are deallocated by the garbage collector once the AppDomain (so in most cases your application) is closed.
If you want to learn more about Garbage Collection, have a look at this article:
http://www.simple-talk.com/dotnet/.net-framework/understanding-garbage-collection-in-.net/