title: C# : Out of Memory exception
body: <p>Today my application threw an <code>OutOfMemoryException</code>. To me this was always almost impossible since I have 4GB RAM and a lot of virtual memory too. The error happened when I tried to add an existing collection to a new list.</p>
  <pre><code>List&lt;Vehicle&gt; vList = new List&lt;Vehicle&gt;(selectedVehicles);  
  </code></pre>
  <p>To my understanding there isn't much memory allocated here since the vehicles my new list should contain already exist inside the memory. I have to admit <code>Vehicle</code> is a very complex class and I tried to add about 50.000 items to the new list at once. But since all <code>Vehicle</code>s in the application come from a database that is only 200MB in size, I have no idea what may cause an <code>OutOfMemoryException</code> at this point.</p>