Re: Please Explain where will the struct be stored if it is declared inside the Class

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"Daniel O'Connell [C# MVP]" <onyxkirx@xxxxxxxxxxxxxxxxxxxxx> wrote in
message news:%23ltNXpmaFHA.740@xxxxxxxxxxxxxxxxxxxxxxx
>
> "thomson" <saintthomson@xxxxxxxxx> wrote in message
> news:1118043123.129544.65490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>> Hi bruce,
>> Frankly Iam in a bit of confusion with the answer you have
>> send, Can u explain me in detail
>>
>
> It doesn't get much more detailed than Jon's article:
>
> http://yoda.arachsys.com/csharp/memory.html
>
>

Agreed, just one small remark though, The article states "Every static
variable is stored on the heap", this is not completely correct if Jon here
meant the GC heap.
Static variables are not stored on the GC heap, but they live on a private,
per application domain heap, more precisely, on the "High Frequency heap"
within the loader heap. So, if you ever wonder where the PairOfInts static
counter variable lives, well it's on the "High Frequency Heap".

Willy.



.



Relevant Pages