The so-called memory leak means that an object or variable that is no longer being used by the program is always occupied in memory. Net has a garbage collection mechanism that ensures that an object is no longer referenced when the object is programmed to orphan, and the object is automatically erased from memory by the garbage collector. Although. NET can reclaim useless objects,. NET still has a memory leak due to improper use. Memory leaks in. NET: Long life-cycle objects that hold references to short lifecycle objects are likely to have a memory leak, although short life-cycle objects are no longer needed, However, because a long life cycle object holds its reference and cannot be recycled, this is the occurrence of a memory leak in. Net, which, in layman's terms, is that the programmer may have created an object that is never used in the future, and that object has been referenced, which is useless but cannot be recycled by the garbage collector. This is a possible memory leak in. Net, for example, the caching system, where we load an object in the cache (for example, in a global Dictionary object), and then never use it again, the object has been cached and referenced, but it is no longer used.
"Reprint" about. NET memory leaks