Are memory leaks possible in managed environments like .NET?

后端 未结 7 1287
梦谈多话
梦谈多话 2021-01-05 02:58

In C++ it is easily possible to have a permanent memory leak - just allocate memory and don\'t release it:

new char; //permanent memory leak guaranteed
         


        
7条回答
  •  自闭症患者
    2021-01-05 03:19

    If we define memory leak as a condition where a memory that can be used for creating objects, cannot be used or a memory that can be released does not then

    Memory leaks can happen in:

    • Events in WPF where weak events need to be used. This especially can happens in Attached Properties.
    • Large objects

    Large Object Heap Fragmentation

    http://msdn.microsoft.com/en-us/magazine/cc534993.aspx

提交回复
热议问题