title: Is it possible to have a memory leak in managed code? (specifically C# 3.0)
body: <p>For instance if I have a hierarchical data structure:</p>
  
  <pre><code>class Node
  {
      public List&lt;Node&gt; children;
  }
  </code></pre>
  
  <p>and it is populated to many levels down then in one of the parents go:</p>
  
  <pre><code>myNode.children.Clear();
  </code></pre>
  
  <p>which will clear all the references to the immediate children - but how about all the grand children, grand grand children etc. that were referenced by those immediate children? Is C# clever enough to know they are no longer needed and they will be garbage collected?</p>
  
  <p>I have read using WPF data binding without implementing interface INotifyChanged can cause memory leaks: <a href="http://blogs.msdn.com/b/micmcd/archive/2008/03/07/avoiding-a-wpf-memory-leak-with-databinding-black-magic.aspx" rel="noreferrer">http://blogs.msdn.com/b/micmcd/archive/2008/03/07/avoiding-a-wpf-memory-leak-with-databinding-black-magic.aspx</a>, how is that possible in a managed environment?</p>