tags:

views:

35

answers:

1

I was reading an article written by Jeffrey Ricther on garbage collection in MSDN. He mentions that "..If NextObjPtr is beyond the end of the address space region, then the heap is full and a collection must be performed"

I would like to know what is this address space region or what is the maximum memory size that CLR allocates to the .NET application which gets fully filled for GC to swing into action?

A: 

The garbage collector is of the generational type, with generation 0 having initially 256 KB, generation 1 2 MB and generation 2 has 10 MB. But these are only the initial values. Depending on the behavior of your program, they will grow or shrink.

Note that I am taking these values from J. Richter's book (CLR via C#, 2nd edition), page 506.

On a 32-bit OS, the maximum usable virtual address space is 2 GB (3 GB if you boot with /3GB switch and have some specific Windows edition). The rest is reserved by Windows itself.

But this space is shared with your EXE and DLLs (including .NET but not the system DLLs), as well as with the necessary data structures for the JIT compiler and the rest of .NET. So, it's less than 2 GB, but your mileage may vary.

Timores
Thanks. I am interested to know how much they can grow? 4 GB?
I edited the answer to include this.
Timores