Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does the common language runtime terminate?

Tags:

c#

.net

clr

There's a useful warning in the performance section on string interning on MSDN:

the memory allocated for interned String objects is not likely be released until the common language runtime (CLR) terminates.

But: when does the CLR terminate?

like image 893
Tim Barrass Avatar asked Dec 19 '13 11:12

Tim Barrass


People also ask

How does common language runtime work?

CLR manages the execution of programs written in different supported languages. CLR transforms source code into a form of bytecode known as Common Intermediate Language (CIL). At run time, CLR handles the execution of the CIL code.

What is CLR and how it works?

The Common Language Runtime (CLR) is programming that manages the execution of programs written in any of several supported languages, allowing them to share common object-oriented classes written in any of the languages. It is a part of Microsoft's . NET Framework.

How does CLR work in C#?

Common Language Runtime (CLR) manages the execution of . NET programs. The just-in-time compiler converts the compiled code into machine instructions. This is what the computer executes.


1 Answers

The simple answer is: the CLR terminates when the host (process) terminates.

Also, there is a default AppDomain (that is not accessible). This AppDomain would continue to exist even if your AppDomain is unloaded. This is what I think Tigran was referring to as System.

like image 198
Hezi Avatar answered Oct 06 '22 01:10

Hezi