Foundamentals of Garbage Collection

The Garbage Collector servers as an automatic memory manager.

It provides the following benefits:

  • Enables you to develop your application without having to free memory.
  • Allocates objects on the managed heap efficiently.
  • Reclaims objects that are no longer being used,clears their memory,and keeps the memory available for future allocations.Managed objects automatically get clean content to start with,so their construtors do not have to initialize every data field.
  • Provides memory safety by making sure that an object cannot use the content of another object.

http://www.microsoft.com/china/MSDN/library/netFramework/netframework/NFdotnetgcbasics.mspx?mfr=true

http://msdn.microsoft.com/zh-cn/library/s5zscb2d%28v=vs.80%29.aspx

原文地址:https://www.cnblogs.com/daishuguang/p/3012544.html