Of course, CLR cannot "know" in advance how much memory an application is going to request from the heap. To best of my knowledge, the heap in only limited by the total heap pool available in the whole system, which is, in turn, depends on total (system-wide) memory available to applications.
If, by some reason, you would need to develop memory-budgeted application which gets some guaranteed amount of heap memory in advance, to ensure increased dependability of some critical memory-heavy application, you could use the suballocation memory techniques. This should give you an idea.
http://en.wikipedia.org/wiki/Block_suballocation[
^].
As to .NET, it is not oriented this way, so you would need considerable effort to achieve this in any more or less universal ways. In principle, this is quite possible though.
[EDIT]
The detail of Large Object Heap with CLR is covered here:
http://msdn.microsoft.com/en-us/magazine/cc534993.aspx[
^].
I don't thing there are any restrictions on the application level. The CLR heap structure is shared by all of the applications on the system.
Here is some basic background for it: The whole point of having managed memory and managed pointer instead of "regular" pointers is to make a loose coupling between referenced object and physical memory (or rather event linear, virtual, paged memory presented as a flat address space, according to the Windows OS design, as well as many other modern OS). The mechanism of references is maintained the way that a reference is always guarantee to access the real object, which can be garbage-collected only when it becomes
unreachable. At the same time, the position of the object in the OS application address space can be moved during run time.
The mechanism of garbage collection and the role of
reachability is explained here:
http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29[
^].
In particular, such heap architecture allows CLR to optimize the heap structure on the fly, prevent excessive fragmentation, etc. For this purpose, CLR can shift allocation of the memory from one process to another. When some process requires more heap of LOH memory, CLR tries to deliver it, rearranging the heap structure if it helps to resolve the memory allocation problem at a given moment of time.
—SA