title: Garbage collection of the object created in infinite loop
body: <p>I have a very basic question. </p>
  
  <p>I write a loop like this:</p>
  
  <pre><code>while(true)
  {
     MyTestClass myObject = new MyTestClass();
  }
  </code></pre>
  
  <ol>
  <li>When will be the object created in
  the loop, garbage collected?</li>
  <li>Also, for every iteration, is it
  that the new memory location is
  allocated to the myObject reference?</li>
  <li>What if i write <code>myObject = null;</code> at the end of every iteration?</li>
  </ol>