title: C# heap space allocation when boxing and unboxing
body: <p>Been using C# for a while and I've been thinking this:</p>
  
  <pre><code>public static void Main(Strings[] args){
      ...
      Person p = new Person("Bob",23,"Male");
      List&lt;Object&gt; al = new List&lt;Object&gt;();
      al.Add(p);
      Person p = (Person)al[0];
  }
  </code></pre>
  
  <p>A typical example of boxing and unboxing in Collection, but question is: when boxing the variable, the CLR allocates a extra space in GC heap and treat p as object, yet the Person class is "larger" than System.Object</p>
  
  <p>So according to that, that may lose some values that Person class owns additionally,  it will fail to get some data after unboxing.</p>
  
  <p>How CLR work that out?</p>
  
  <p>Any solutions are welcomed</p>