W3C home > Mailing lists > Public > www-lib@w3.org > July to September 2003

Re: HtNet_Delete: memory leak...???

From: Richard Atterer <richard@list03.atterer.net>
Date: Tue, 26 Aug 2003 19:46:45 +0200
To: "Sinha, Raj (Raj)" <rajsinha@avaya.com>
Cc: www-lib@w3.org
Message-ID: <20030826174645.GA6790@nenya.lan>

Hi Raj,

On Tue, Aug 26, 2003 at 11:01:38AM -0400, Sinha, Raj (Raj) wrote:
> I have been trying to find this leak but with no luck. 
> 
> The embedded platform tools tell me that I am loosing about 8kb for
> every request.

Can you reproduce the problem on a platform where you can run the process
with "valgrind --leak-check=yes"? I've found valgrind to be invaluable for
this kind of thing.

This may not be helpful, but in my own app, I *don't* see a per-request 
memory leak. However, I only use simple HTTP/FTP requests, no post, no 
pipelining so far, no cookies or any other fancy things.

> And the trace of the CORE is as below. I do see that the net object is
> being deleted. Can someone point me in the right direction please. Is
> there a documented leak in HTNet_NewClient that I am not aware of...

Not for me! Maybe you should have a look at how you initialize libwww and 
which actions you perform per-download; maybe some of these actions only 
need to be performed once, after start-up. For example, things like 
HTProfile_newNoCacheClient() should only be called once, I think.

My code:
<http://cvs.berlios.de/cgi-bin/viewcvs.cgi/jigdo/jigdo/src/net/download.cc>

Cheers,

  Richard

-- 
  __   _
  |_) /|  Richard Atterer     |  GnuPG key:
  | \/|  http://atterer.net  |  0x888354F7
   '` 
Received on Tuesday, 26 August 2003 16:07:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:43 GMT