Re: Object cleanup

2012-05-31 Thread Oscar Benjamin
On 31 May 2012 11:57, psaff...@googlemail.com wrote: > Thanks for all the responses. > > It looks like none of the BeautifulSoup objects have __del__ methods, so I > don't think that can be the problem. > > To answer your other question, guppy was the best match I came up with > when looking for a

Re: Object cleanup

2012-05-31 Thread psaff...@googlemail.com
Thanks for all the responses. It looks like none of the BeautifulSoup objects have __del__ methods, so I don't think that can be the problem. To answer your other question, guppy was the best match I came up with when looking for a memory profile for Python (or more specifically "Heapy"): http

Re: Object cleanup

2012-05-30 Thread Ben Finney
Steven D'Aprano writes: > The destructor doesn't get called into the last reference is gone. And it's important to note that the destructor doesn't get called *immediately* that happens; rather, the destructor will be called *some time after* the last reference to the object is gone. In short:

Re: Object cleanup

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 16:56:21 +, John Gordon wrote: > In <6e534661-0823-4c42-8f60-3052e43b7...@googlegroups.com> > "psaff...@googlemail.com" writes: > >> How do I force the memory for these soup objects to be freed? > > Have you tried deleting them, using the "del" command? del doesn't actu

Re: Object cleanup

2012-05-30 Thread John Gordon
In <6e534661-0823-4c42-8f60-3052e43b7...@googlegroups.com> "psaff...@googlemail.com" writes: > How do I force the memory for these soup objects to be freed? Have you tried deleting them, using the "del" command? -- John Gordon A is for Amy, who fell down the stairs gor...@pa

Re: Object cleanup

2012-05-30 Thread Chris Rebert
On Wed, May 30, 2012 at 9:40 AM, Steven D'Aprano wrote: > On Wed, 30 May 2012 09:01:20 -0700, psaff...@googlemail.com wrote: > >> However, I've found that using guppy, after the methods have returned >> most of the memory is being taken up with BeautifulSoup objects of one >> type or another. I'm

Re: Object cleanup

2012-05-30 Thread Steven D'Aprano
On Wed, 30 May 2012 09:01:20 -0700, psaff...@googlemail.com wrote: > However, I've found that using guppy, after the methods have returned > most of the memory is being taken up with BeautifulSoup objects of one > type or another. I'm not declaring BeautifulSoup objects anywhere else. What's gupp

Object cleanup

2012-05-30 Thread psaff...@googlemail.com
I am writing a screen scraping application using BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ (which is fantastic, by the way). I have an object that has two methods, each of which loads an HTML document and scrapes out some information, putting strings from the HTML documents i