Do static properties end up living in gen2?

When I have a field / property staticthat lives in my application pool for the life of the application pool, where does it live in memory? I assume that he was promoted to gen2and lived there his days? (assuming it is small enough not to fall into LOH )

+3
source share
1 answer

Static properties live on the heap in the memory space allocated to the type object for the type / class. They load at the same time as the type is loaded.

Static properties cannot be garbage collected. An object of type can never be unloaded.

4 CLR # . : enter image description here

( - ) Employee . Type , System.Type.

+4

All Articles