title: Byte size of object including size of members
body: <p>I want to know (for debugging and logging) the size of an object in bytes, but not like</p>
  
  <pre><code>Sizeof (Object)
  </code></pre>
  
  <p>but like a 'deep sizeof'. For example if the object contains a hash map or a list, the real size needed by that hash map or list should be added to the result. Is there any way to do this without having to add a</p>
  
  <pre><code>property Size : LongWord read GetByteSize;
  </code></pre>
  
  <p>to each and every little object?</p>
  
  <p>Probably a stupid question, but I'll give it a try ;)</p>
  
  <p><strong>EDIT</strong>: Just found almost the same question:</p>
  
  <p><a href="https://stackoverflow.com/questions/482604/recursive-class-instance-size-in-delphi">Recursive Class Instance Size in Delphi</a></p>
  
  <p>I guess, the question can be closed. Sorry about that!</p>