title: python. get size of an object
body: <p>I need to know size of objects in my python program.
  I have <code>for</code> loop in which I need to know size of objects.
  If I use <code>sys.getsizeof</code> then memory does not free instantly
  and I cannot see actual size. Is there way to do it?</p>
  
  <p>My objects are json and string. In the worst case I can 
  save them to file and look at file sizes. But how can I look
  at file size from python code?</p>
  
  <p><strong>Edit</strong>: size of serialised objects is more important for me.
  so second part of the question is essential. </p>
  
  <p>Thanks.</p>