Memory for static variables are normally held in some rooted (and hidden) object[]
. This can be seen doing a !gcroot on the object in WinDbg (with SOS).
Just to add, these references can never be GC’ed (unless you null the field), as I discovered recently.
More Related Contents:
- Setting Objects to Null/Nothing after use in .NET
- Does using “new” on a struct allocate it on the heap or stack?
- Attempted to read or write protected memory. This is often an indication that other memory is corrupt
- Implementing IDisposable correctly
- What strategies and tools are useful for finding memory leaks in .NET?
- Large Object Heap Fragmentation
- Is there any benefit of using an Object Initializer?
- .NET Memory issues loading ~40 images, memory not reclaimed, potentially due to LOH fragmentation
- C# memory address and variable
- High memory consumption with Enumerable.Range?
- Initial capacity of collection types, e.g. Dictionary, List
- What causes memory fragmentation in .NET
- How do I get .NET to garbage collect aggressively?
- Memory limitations in a 64-bit .Net application?
- Large Object Heap Compaction, when is it good?
- Cleanest way to write retry logic?
- Casting interfaces for deserialization in JSON.NET
- What is the use of ObservableCollection in .net?
- Could not find a part of the path … bin\roslyn\csc.exe
- What .NET collection provides the fastest search
- Combining multiple Attributes to a single Attribute – Merge Attributes
- WebBrowser print settings
- How to retrieve the LoaderException property?
- Send JSON via POST in C# and Receive the JSON returned?
- How can I Unescape and Reescape strings in .net?
- Interoperating between Matlab and C#
- How do I force full post-back from a button within an UpdatePanel?
- All cases covered Bresenham’s line-algorithm [closed]
- How do I get a return value from Task.WaitAll() in a console app?
- How to empty/flush Windows READ disk cache in C#?