.NET memory management

Can someone provide a very high-level overview of .NET memory management?

In particular, I am looking for an overview of memory management.

  • is there a common .net heap?
  • are heap based?
  • When I run my application, is it the new allocated heap / memory or memory from the excess .net heap.
  • What happens when the .net heap runs out of source memory? Does he request more from the OS?
  • The basics would be a great start for me to then continue and read more
+4
source share
2 answers

Each process has its own heap - and if more memory is required after the GC clears everything it can, the process requests the OS for more information.

The best resource I know about such information is Jeffrey Richter’s CLR book via C # .

+2
source

is there a common .net heap?

There's a lot. The ones you usually care about are garbage collectors 0, 1, and 2, heaps of large objects, and a bunch of loaders. Generations help make the garbage collector more efficient. LOH is used for objects that are too large to move. The loader heap stores the values ​​of a static variable.

are heap apps?

No, they are based on AppDomain. AppDomains provide a cheap alternative to the process.

When I run my application, this is a new heap, created / allocated memory, or memory from the excess .net heap.

The CLR, by default, creates the main AppDomain with the heaps associated with it before your code starts working.

what happens when the .net heap runs out of source memory? Does he request more from the OS?

Yes.

+1
source

All Articles