Memory leak in LWP is not cured with perl's malloc()

Ilya Ketris (ilya@gde.to)
Wed, 21 Jul 1999 02:41:24 +0300


	After having studied other people's reports about memory
	leak in LWP, which I am experiencing myself, I have
	followed the single suggestion I saw from the honored
	author -- recompiled perl with usemyalloc=y -- and alas,
	it is still there.


################
#!/usr/bin/perl -w
use strict;
use HTTP::Response;
use LWP::UserAgent;
use Data::Dumper;

  my $ua = new LWP::UserAgent;
  my $path = 'http://www';
  my $request = new HTTP::Request('GET', $path);
  my $response;

while(1) {
     $response = $ua->request($request);
}
################

	This program grows in size.  If you substitute
	'http://www' with 'www', making it invalid URI, or with
	'http://nosuchhost', making it not to resolve, it does
	NOT grow.  'ftp://ftphost' grows as well.


	I am using RedHat 6.0 based system, currenty running

	linux 2.2.5 
	perl:

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.5-15, archname=i586-linux
    uname='linux kelia.okb.lv 2.2.5-15 #1 mon apr 19 22:21:09 edt
1999 i586 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
    alignbytes=4, usemymalloc=y, prototype=define

	$LWP::VERSION == 5.44

-- 
Ilya Ketris <ilya@gde.to>