- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Managed and Unmanaged code in .NET
.NET Framework has CLR, Common Language Runtime which execute the code written in .NET languages. CLR manages the memory needs, security concern, code optimization, platform specific conversion etc. In case of Unmanaged code, no CLR is present, and code is directly executed by Operating system.
Following are some of the important differences between Managed and Unmanaged code.
|Sr. No.||Key||Managed Code||Unmanaged code|
|1||Executed By||Executed by CLR, Common Language Runtime, also named as Managed Runtime Environment.||Executed by Operating System directly on the underlying hardware.|
|2||Security||CLR handles security concerns and provides inbuilt security to code written in .NET.||No inbuilt security present. It is developer's responsibility to write safe and secure code.|
|3||Memory Overflow||Memory buffer overflow never happens, as CLR handles memory allocation and deallocation automatically.||Memory buffer overflow can occur and can hamper the program execution badly.|
|4||Runtime Services||CLR provides automatic garbage collection, exception handling to managed code.||No automatic garbage collection and other services are provided to unmanaged code.|
|5||Output||Managed Code is converted to IL, Intermiddiate Language also termed as CIL of MSIL.||Unmanaged Code is converted to native language code.|
|6||Low Level Access||Programmer has no low level access using Managed Code.||Programmer can write low level access code using unmanaged code.|
- Related Articles
- Managed code vs Unmanaged code in C#
- Difference between a Managed and an Unmanaged Switch
- What is unmanaged code in C#?
- What is unsafe/unmanaged code in C#?
- Difference between C# and .Net
- Write the difference between Net operating income and net income.
- What is a managed code in C#?
- Write the difference between EBITDA and net income.
- Difference between Bytecode and Machine Code
- Difference between IDE and Code Editor
- Write the difference between present value and net present value.
- Difference between Net Present Value (NPV) and Profitability Index (PI)
- Comparison between C# and .NET Framework
- Distinguish between EBIT and net income.
- Managed Care and Ethics