[Baypiggies] find memory leaks in running program

Jason Culverhouse jason at mischievous.org
Tue Dec 7 18:20:57 CET 2010


On Dec 7, 2010, at 9:04 AM, Marco Hornung wrote:

> Hey,
> 
> ------------------------------------------------------------------------------------------
> questions
> ------------------------------------------------------------------------------------------
> 1. What are the best tools to analyze pythons memory stack, while it is running?

I've had some luck with Dowser http://www.aminus.net/wiki/Dowser 
There is a blog post about using it with twisted
http://www.aminus.org/blogs/index.php/2008/06/11/tracking-memory-leaks-with-dowser?blog=2

> 2. Is there a possibility to analyze the memory stack of a program with external programs? (without to change the source code - I am only interested in the object size)

> 3. Can I sort of "break" into the memory to see what objects consume how much memory?
There is always this trick... Just start an imbedded I Python shell from some handler

from IPython.Shell import IPShellEmbed; IPShellEmbed()()

Then just poke around with the gc module
Jason

> 
> ------------------------------------------------------------------------------------------
> my scenario
> ------------------------------------------------------------------------------------------
> I have to debug a multithreaded server, which is written in the twisted-framework. One of the processes has some sort of memory leak - After one of our jobs is finished the main process has still over 59% of the entire memory allocated. I will probably have to recreate our scenario and equip our server with some memory sensors - but  it takes 12h to reproduce the scenario and I will have to change the source code(at least I do not know of other options).
> Therefore I am looking for quicker possibilities to look into what causes our memory leak.
> 
> Regards,
> Marco
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies



More information about the Baypiggies mailing list