title: What is the easiest way to find out how much memory an object uses in .NET?
body: <p>What is the easiest way to find out how much memory an object uses in .NET?</p>
  
  <p>Preferably without having to resort to a third party tool.  Marshal.SizeOf or the sizeof operator look useful but only work with a restricted range of types.</p>
  
  <p>Some related posts:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/109836/object-memory-analysis-in-net">Object Memory Analysis in .NET</a></li>
  <li><a href="https://stackoverflow.com/questions/151936/does-an-empty-array-in-net-use-any-space">Does an empty array in .NET use any space?</a></li>
  </ul>