Are rows and static garbage fields collected?

When are rows and static fields returned by the garbage collector?

I ask about this because I know that staticASP.NET is always alive.

+5
source share
4 answers

Lines are objects and will be collected in the absence of references.

Static fields

usually keep a permanent reference to the object and thus do not allow to collect these objects. But as long as you still need these objects, everything is fine.

+3
source

, . , , , , , , (, , - , , ).

, . . , .

+5

static, , , static Type . , , AppDomain , , GC.

strings , . , - AppDomain . , string , GC.

, , AppDomain , .

+2

, . , .

+1

All Articles