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.