What is CLR?

Source: Internet
Author: User

The CLR (Public Language Runtime) is also a runtime environment like the Java Virtual Machine. It is responsible for resource management (memory allocation and garbage collection ), and ensure the necessary separation between the application and the underlying operating system .. NET providesRuntimeEnvironment, calledCommen Language Runtime)Is a multi-language execution environment that supports many data types and language features. He managesCodeAnd make the development process easier. This is a controllable execution environment, and its functions are presented together with other tools through the compiler.

The code developed by a runtime compiler is calledControllable codeManaged code. The opposite is the unmanaged code.

Metadata metadata: To enable the runtime environment to provide services to controllable code, the language compiler needs to generate a metadata that provides the type, member, and reference information in the language in use. The runtime environment uses metadata to locate and load the class, expand the object instance in the memory, solve the problem of calling the method, generate local code, enforce the security, and establish the runtime environment boundary.

The definition of controllable execution: the object is completely controlled by the runtime environment during execution. The runtime environment provides the following services: automatic memory management, debugging support, enhanced security, and interoperability with non-operable code. Condition: 1. Select the language compiler for the runtime, such as VB and C #. 2. Use the language features required by CLR in the output type of the component.

To improve the reliability of the platform and the stability level required by transaction-oriented e-commerce applications, CLR is also responsible for other tasks, such as monitoring.Program. According to the. NET
The programs running under CLR monitoring belong to the "managed" code, applications or components running directly on bare metal, not under CLR, are "unmanaged"
(Unmanaged) code.

CLR will monitor various common programming errors. These errors have been the main source of software faults for many years, including access to array elements out of bounds and access to unallocated memory space, memory overflow caused by a large data volume.

However
However, this kind of running monitoring of managed code has a price. Although it is not possible to accurately obtain the overhead required for the program running, the performance of the current beta test is as follows:
As Microsoft acknowledges, we can expect the performance reduction caused by it to be at least 10%. Of course, if the monitoring program runs, the stability and availability can be improved to a new level,
We can doubt whether the performance reduction of 10% is a bad thing ......

The above is transferred from:

Http://www.kmcenter.org/blog/user1/191/archives/2004/386.html

Http://i-t.org.cn/html/biancheng/200703/2011.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.