code_junkie

Python memory profiler

Nov 11th, 2011
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. from guppy import hpy
  2. h = hpy()
  3. print h.heap()
  4.  
  5. Partition of a set of 132527 objects. Total size = 8301532 bytes.
  6. Index Count % Size % Cumulative % Kind (class / dict of class)
  7. 0 35144 27 2140412 26 2140412 26 str
  8. 1 38397 29 1309020 16 3449432 42 tuple
  9. 2 530 0 739856 9 4189288 50 dict (no owner)
  10.  
  11. # memdebug.py
  12.  
  13. import cherrypy
  14. import dowser
  15.  
  16. def start(port):
  17. cherrypy.tree.mount(dowser.Root())
  18. cherrypy.config.update({
  19. 'environment': 'embedded',
  20. 'server.socket_port': port
  21. })
  22. cherrypy.server.quickstart()
  23. cherrypy.engine.start(blocking=False)
Add Comment
Please, Sign In to add comment