Static Class Distribution

Are stacks of static classes allocated in C #?

Since they cannot be created, I suggest that this should be done.

+5
source share
2 answers

They are stored inside a heap area called the High Frequency Heap. You can find more information in this code article. Static keyword Demystified

+10
source

I understand that static classes are allocated on the heap (using the static constructor when the type is initialized).

If they were on the stack, you would quickly end the stack space if you had many static classes.

+5
source

All Articles