source: people/peter.buschman/backup_monitoring/debug/_debug.py@ 976

Last change on this file since 976 was 976, checked in by peter, on Dec 6, 2011 at 10:19:33 AM

Raw checkin of current NetBackup / TSM parsing code.

File size: 349 bytes
RevLine 
[976]1from guppy import *
2
3##
4## heapsize() - Return size of heap (memory used by objects) in MB
5##
6def heapsize(format='string'):
7
8 heapsize = hpy().heap().size / 1024.0 / 1024.0
9
10 if format == 'string':
11 return '%.2f MB' % (heapsize)
12 elif format == 'int':
13 return int(heapsize)
14 else:
15 return heapsize
16
Note: See TracBrowser for help on using the repository browser.