title: .net Garbage Collection and managed resources
body: <p>Is the memory from primitive data types (int, char,etc) immediately released once they leave scope, or added to garbage collection for later release?</p>
  
  <p>consider:</p>
  
  <pre><code>For x as integer=0 to 1000
  dim y as integer
  Next
  </code></pre>
  
  <p>If this doesn't add 1000 integers to the garbage collector for clean up later,
  how does it treat string objects? would this create 1000 strings to clean up later?</p>
  
  <pre><code>For x as integer=0 to 1000
  dim y as string=""
  Next
  </code></pre>
  
  <p>How about structures that contain only int,string,etc... data types?</p>
  
  <p>Classes that contain only managed resources?</p>