RE: Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Curt Powell

I applied the patch and it seems to work.  Thanks!

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Gisle Aas
Sent: Tuesday, April 10, 2001 11:36 AM
To: Curt Powell
Cc: [EMAIL PROTECTED]
Subject: Re: Bug report: Memory leak with LWP::UserAgent/HTTP::Request
under RH Linux 6.1/7


"Curt Powell" <[EMAIL PROTECTED]> writes:

> Yes, I am using 3.20.  I will attempt to revert to 3.19 and rerun my test.

This patch fixes the leak in 3.20.  Expect to see HTML-Parser-3.21
pretty soon :-(

Regards,
Gisle


Index: hparser.c
===
RCS file: /cvsroot/libwww-perl/html-parser/hparser.c,v
retrieving revision 2.67
retrieving revision 2.68
diff -u -p -u -r2.67 -r2.68
--- hparser.c   2001/04/06 20:03:24 2.67
+++ hparser.c   2001/04/10 18:33:27 2.68
@@ -1,4 +1,4 @@
-/* $Id: hparser.c,v 2.67 2001/04/06 20:03:24 gisle Exp $
+/* $Id: hparser.c,v 2.68 2001/04/10 18:33:27 gisle Exp $
  *
  * Copyright 1999-2001, Gisle Aas
  * Copyright 1999-2000, Michael A. Chase
@@ -243,6 +243,7 @@ report_event(PSTATE* p_state,
SvREFCNT_dec(tagname);
return;
}
+   SvREFCNT_dec(tagname);
}
else if (p_state->ignoring_element) {
return;





Re: Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Gisle Aas

"Curt Powell" <[EMAIL PROTECTED]> writes:

> Yes, I am using 3.20.  I will attempt to revert to 3.19 and rerun my test.

This patch fixes the leak in 3.20.  Expect to see HTML-Parser-3.21
pretty soon :-(

Regards,
Gisle


Index: hparser.c
===
RCS file: /cvsroot/libwww-perl/html-parser/hparser.c,v
retrieving revision 2.67
retrieving revision 2.68
diff -u -p -u -r2.67 -r2.68
--- hparser.c   2001/04/06 20:03:24 2.67
+++ hparser.c   2001/04/10 18:33:27 2.68
@@ -1,4 +1,4 @@
-/* $Id: hparser.c,v 2.67 2001/04/06 20:03:24 gisle Exp $
+/* $Id: hparser.c,v 2.68 2001/04/10 18:33:27 gisle Exp $
  *
  * Copyright 1999-2001, Gisle Aas
  * Copyright 1999-2000, Michael A. Chase
@@ -243,6 +243,7 @@ report_event(PSTATE* p_state,
SvREFCNT_dec(tagname);
return;
}
+   SvREFCNT_dec(tagname);
}
else if (p_state->ignoring_element) {
return;




RE: Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Curt Powell

Yes, I am using 3.20.  I will attempt to revert to 3.19 and rerun my test.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Gisle Aas
Sent: Tuesday, April 10, 2001 10:49 AM
To: Curt Powell
Cc: [EMAIL PROTECTED]
Subject: Re: Bug report: Memory leak with LWP::UserAgent/HTTP::Request
under RH Linux 6.1/7


Gisle Aas <[EMAIL PROTECTED]> writes:

> "Curt Powell" <[EMAIL PROTECTED]> writes:
>
> > I have encountered a memory leak under RedHat Linux (versions 6.1 and
7),
> > Perl 5.005 and 5.6.  It occurs with multiple calls to LWP::UserAgent and
> > HTTP::Request.  Following is a short script that demonstrates the
problem.
> > On RH7 it shows memory deltas of 8k every 10 or so iterations after the
> > first iteration.  The amount leaked doesn't seem to be related to the
size
> > of the page downloaded.  Is it possible that I am not doing the call
> > sequence correctly?
>
> Seems good enough to me.  I also see memory leaking here.
> I'll try to investigate.

Did you use HTML-Parser 3.20 for your test?

The memory leak went away for me when I downgraded to HTML-Parser 3.19.

Regards,
Gisle


> > #!/usr/bin/perl
> > #usage: ./memtest  e.g. ./memtest http://www.sierraridge.com
> >
> > sub geturl()
> > {
> > use LWP::UserAgent;
> > use HTTP::Request;
> > my $URL = shift;
> > my $UA = LWP::UserAgent->new();
> > my $Request = HTTP::Request->new(GET => $URL);
> > my $Response = $UA->request($Request);
> > print "Error retrieving $URL\n" if ($Response->is_error());
> > return $Response->as_string;
> > }
> >
> > sub memused
> > {
> > local *memused_TMP_FILE;
> > open(memused_TMP_FILE, " > my $a = ;
> > close memused_TMP_FILE;
> > my @b = split(' ', $a);
> > return $b[22];
> > }
> >
> > $url = shift ARGV;
> > $lastused = &memused();
> > for ($i=0; $i<=100; ++$i)
> > {
> > $length = length(&geturl($url));
> > $used = &memused;
> > $delta = $used - $lastused;
> > print "$i: response length: $length memory used: $used memory change:
> > $delta\n";
> > $lastused = $used;
> > }




Re: Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Gisle Aas

Gisle Aas <[EMAIL PROTECTED]> writes:

> "Curt Powell" <[EMAIL PROTECTED]> writes:
> 
> > I have encountered a memory leak under RedHat Linux (versions 6.1 and 7),
> > Perl 5.005 and 5.6.  It occurs with multiple calls to LWP::UserAgent and
> > HTTP::Request.  Following is a short script that demonstrates the problem.
> > On RH7 it shows memory deltas of 8k every 10 or so iterations after the
> > first iteration.  The amount leaked doesn't seem to be related to the size
> > of the page downloaded.  Is it possible that I am not doing the call
> > sequence correctly?
> 
> Seems good enough to me.  I also see memory leaking here.
> I'll try to investigate.

Did you use HTML-Parser 3.20 for your test?

The memory leak went away for me when I downgraded to HTML-Parser 3.19.

Regards,
Gisle


> > #!/usr/bin/perl
> > #usage: ./memtest  e.g. ./memtest http://www.sierraridge.com
> > 
> > sub geturl()
> > {
> > use LWP::UserAgent;
> > use HTTP::Request;
> > my $URL = shift;
> > my $UA = LWP::UserAgent->new();
> > my $Request = HTTP::Request->new(GET => $URL);
> > my $Response = $UA->request($Request);
> > print "Error retrieving $URL\n" if ($Response->is_error());
> > return $Response->as_string;
> > }
> > 
> > sub memused
> > {
> > local *memused_TMP_FILE;
> > open(memused_TMP_FILE, " > my $a = ;
> > close memused_TMP_FILE;
> > my @b = split(' ', $a);
> > return $b[22];
> > }
> > 
> > $url = shift ARGV;
> > $lastused = &memused();
> > for ($i=0; $i<=100; ++$i)
> > {
> > $length = length(&geturl($url));
> > $used = &memused;
> > $delta = $used - $lastused;
> > print "$i: response length: $length memory used: $used memory change:
> > $delta\n";
> > $lastused = $used;
> > }



Re: Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Gisle Aas

"Curt Powell" <[EMAIL PROTECTED]> writes:

> I have encountered a memory leak under RedHat Linux (versions 6.1 and 7),
> Perl 5.005 and 5.6.  It occurs with multiple calls to LWP::UserAgent and
> HTTP::Request.  Following is a short script that demonstrates the problem.
> On RH7 it shows memory deltas of 8k every 10 or so iterations after the
> first iteration.  The amount leaked doesn't seem to be related to the size
> of the page downloaded.  Is it possible that I am not doing the call
> sequence correctly?

Seems good enough to me.  I also see memory leaking here.
I'll try to investigate.

Regards,
Gisle


> 
> Regards,
> 
> Curt Powell
> 
> #!/usr/bin/perl
> #usage: ./memtest  e.g. ./memtest http://www.sierraridge.com
> 
> sub geturl()
> {
>   use LWP::UserAgent;
>   use HTTP::Request;
>   my $URL = shift;
>   my $UA = LWP::UserAgent->new();
>   my $Request = HTTP::Request->new(GET => $URL);
>   my $Response = $UA->request($Request);
>   print "Error retrieving $URL\n" if ($Response->is_error());
>   return $Response->as_string;
> }
> 
> sub memused
> {
>   local *memused_TMP_FILE;
>   open(memused_TMP_FILE, "   my $a = ;
>   close memused_TMP_FILE;
>   my @b = split(' ', $a);
>   return $b[22];
> }
> 
> $url = shift ARGV;
> $lastused = &memused();
> for ($i=0; $i<=100; ++$i)
> {
>   $length = length(&geturl($url));
>   $used = &memused;
>   $delta = $used - $lastused;
>   print "$i: response length: $length memory used: $used memory change:
> $delta\n";
>   $lastused = $used;
> }



Bug report: Memory leak with LWP::UserAgent/HTTP::Request under RH Linux 6.1/7

2001-04-10 Thread Curt Powell

Dear sir or madam,

I have encountered a memory leak under RedHat Linux (versions 6.1 and 7),
Perl 5.005 and 5.6.  It occurs with multiple calls to LWP::UserAgent and
HTTP::Request.  Following is a short script that demonstrates the problem.
On RH7 it shows memory deltas of 8k every 10 or so iterations after the
first iteration.  The amount leaked doesn't seem to be related to the size
of the page downloaded.  Is it possible that I am not doing the call
sequence correctly?

Regards,

Curt Powell

#!/usr/bin/perl
#usage: ./memtest  e.g. ./memtest http://www.sierraridge.com

sub geturl()
{
use LWP::UserAgent;
use HTTP::Request;
my $URL = shift;
my $UA = LWP::UserAgent->new();
my $Request = HTTP::Request->new(GET => $URL);
my $Response = $UA->request($Request);
print "Error retrieving $URL\n" if ($Response->is_error());
return $Response->as_string;
}

sub memused
{
local *memused_TMP_FILE;
open(memused_TMP_FILE, ";
close memused_TMP_FILE;
my @b = split(' ', $a);
return $b[22];
}

$url = shift ARGV;
$lastused = &memused();
for ($i=0; $i<=100; ++$i)
{
$length = length(&geturl($url));
$used = &memused;
$delta = $used - $lastused;
print "$i: response length: $length memory used: $used memory change:
$delta\n";
$lastused = $used;
}