W3C home > Mailing lists > Public > www-lib@w3.org > April to June 2001

Re: Memory leaks

From: ??? <thedeft@softwise.co.kr>
Date: Sun, 24 Jun 2001 22:49:12 +0900
Message-ID: <000e01c0fcb4$763fa810$0100a8c0@codedeft>
To: <www-lib@w3.org>

  ----- Original Message ----- 
  From: Alex Bosetti 
  To: www-lib@w3.org 
  Sent: Sunday, June 24, 2001 3:57 AM
  Subject: Memory leaks

  Hi all.

  I am experiencing all sorts of memory leaks using the library under win2000.
  I have successfully compiled all the examples, but when I try to run them, all of them leak terribly.

  I can understand the robot, which has to keep track of where is gone, but the showlinks example should release all the memory when is done.
  This latest program leaks 48 byte at every run, other as much as 2048 (depending on the page visited).

  I have used latest csv.

  Compiler: VC sp6 and Bcc 5.5 (both with same result).

  Any idea?
  Could it be the way I have compiled the library ?
Most likely these memory leaks are "HTAnchor" objects. Anchors just keep piling up unless you explicitly erase'em because libwww doesn't have any inherent garbage collection for this object. Use HTAnchor_delete (per anchor) or HTAnchor_deleteAll from time to time. HTML parser also seems to create a lot of empty anchors which are never visited whenever a hyperlink is parsed (with HTAnchor_findChildAndLink). I removed all the HTAnchor_findChildAndLink calls from HTML.c (so that I could create the anchor when the new URL is actually visited) and it saved a substantial amount of memory for the robot.
Received on Sunday, 24 June 2001 09:38:21 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:54 UTC