Are memory leaks possible in managed environments like .NET?

后端 未结 7 1240
梦谈多话
梦谈多话 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:37

    It's not exactly a memory leak, but if you're communicating with hardware drivers directly (i.e. not through a properly-written .net extension of a set of drivers) then it's fairly possible to put the hardware into a state where, although there may or may not be an actual memory leak in your code, you can no longer access the hardware without rebooting it or the PC...

    Not sure if this is a useful answer to your question, but I felt it was worth mentioning.

    0 讨论(0)
提交回复
热议问题