Re: memory leaks - tools and docs

2011-11-24 Thread Mike C. Fletcher
On 11-11-24 10:00 PM, Aljosa Mohorovic wrote:
 i've been trying to find memory leaks in a wsgi application using
 gunicorn to run it and after a lot of time invested in research and
 testing tools i did find a lot of useful information (most really old)
 but i'm left with a feeling that this should be easier, better
 documented and with tools that generate better data.

 if anybody can share some tips, links, docs or better tools with
 better reports i would really appreciate it.
 i'm not against paying for a good tool so any recommendation is
 appreciated.

 i mostly used http://guppy-pe.sourceforge.net/#Heapy but found
 http://pysizer.8325.org/ and http://code.google.com/p/pympler/ also
 interesting.

 Aljosa
Meliae is a similar tool wrt collecting memory-usage information.

RunSnakeRun can process Meliae dumps to produce visualizations of the
memory used in the process.

HTH,
Mike

https://launchpad.net/meliae
http://www.vrplumber.com/programming/runsnakerun/

-- 

  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: memory leaks - tools and docs

2011-11-24 Thread Christian Heimes
Am 25.11.2011 04:00, schrieb Aljosa Mohorovic:
 i mostly used http://guppy-pe.sourceforge.net/#Heapy but found
 http://pysizer.8325.org/ and http://code.google.com/p/pympler/ also
 interesting.

Guppy is a extremely powerful tool because it can also track non GC
objects without a debug build of Python. I only wished it would have a
user friendly and easy to script interface. The _.more thing is killing
me. :(

I'm using a very simple and almost for free approach to keep track of
memory usage with psutil. After every unit test case I store RSS and VM
size with psutil.Process(os.getpid()).get_memory_info(),
threading.active_count(), len(gc.garbage) and len(gc.get_objects()). It
doesn't show what's going wrong, but it helps me to isolate the code
paths, that may introduce memory leaks and reference cycles. Since we
use continuous integration (Jenkins) I can track down regressions more
easily, too.

Christian

-- 
http://mail.python.org/mailman/listinfo/python-list