Roy Reznik
Roy Reznik

Reputation: 2110

Where and how does the CLR allocate memory for JITted code?

Where and how does the CLR allocate memory for JITted code.

Data/Code section, HeapAlloc/VirtualAlloc/something else?

Upvotes: 0

Views: 484

Answers (1)

Hans Passant
Hans Passant

Reputation: 942267

The CLR maintains separate heaps for jitted code as well as the various other bits of information that's specific to types and static objects. The generic term for them is "loader heap" and it is associated with an AppDomain. Which is the basic mechanism by which assemblies, types, jitted code and statics disappear when you unload an AppDomain.

The loader heaps further sub-divide in a high frequency, low frequency and stub heap. Some background info is available in this article.

Upvotes: 1

Related Questions