Will these variables be garbage-collected?
<p>I was practicing my coding chops today and solving the "remove all elements of a certain value from a linked list" problem today. The solution I came up with was</p>

<pre><code>public void RemoveAll ( T val ) 
{
    if(_root == null)
       return;

    if(_root.Value == val)
    {
       _root = _root.Next;
       RemoveAll(val);
    }    

    Node last = _root, 
          cur = _root.Next;  
    while(cur != null)
    {
       if(cur.Value == val)
           last.Next = cur.Next;
       else
           last = cur;
       cur = cur.Next;
    }
}
</code></pre>

<p>and here's my question: </p>

<p>When <code>cur.Value == val</code> I'm doing something like changing the list from </p>

<pre><code>A -&gt; B -&gt; C
</code></pre>

<p>to </p>

<pre><code>A -&gt; C
</code></pre>

<p>Will the compiler or run-time environment see that <code>B</code> is no longer in use and dispose of it? Or should I do that explicitely? </p>

<p>I have a second question which is whether a call stack blows up for recursive <code>void</code> methods. As you see here, there is a chance of the method calling itself. But since it's a method that doesn't return a value, can't the run-time environment just wipe the data about the last call? There is no reason for it to remain in memory (right?). </p>