Managed and unmanaged

Source: Internet
Author: User

Managed and unmanaged memory are modified.
Hosting means you don't need to operate on the memory directly. Tell me when you need it. I will apply for it for you and use it for you. If you use it, you can tell me that I will release it for you. If you are busy and forget to tell me, I will release it for you on a regular basis. This is hosting. You don't deal with direct memory, but with. Net CLR.
Hosting means you have to manage the memory. Here we will talk about memory management. In fact, it is only the memory management on the stack. The stack memory is the same as the previous one. When the function exits, it is released. The memory on the heap needs to be allocated by itself, and the constructor is called (required by C, c ++ uses new to replace this operation.) after use, you need to release the memory yourself. If you are not careful, you just want to lose the memory pointer, this may cause memory leakage, which cannot be remedied before your program exits, so be careful. (Virtualmalloc is not described here. Because the allocated memory is not the heap memory, it is an extended memory space .)

Simply put, hosting means hosting the memory, but a single layer of memory will inevitably slow down. Is it possible that Microsoft has already considered it, and the hardware upgrade will not solve the problem if everyone pays for it. The advantage is that the managed memory does not have the risk of leakage.

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.