From: guru prasad <pnguruji@yahoo.com>
To: pgsql-interfaces@postgresql.org
Cc: Ian Barwick <barwick@gmx.net>
Subject: Re: Memory leak!!
Date: Thu, 10 Apr 2003 07:39:00 -0700 (PDT)
Message-ID: <20030410143900.91502.qmail@web41505.mail.yahoo.com> (raw)
In-Reply-To: <200304090838.09883.barwick@gmx.net>
Hi All,
> while (1) {
> my $sth = $Dbh->prepare("select user_id from users
> limit 1");
> print "sql executed and returned :",
> $sth->execute, "\n";
> $sth->finish();
> }
>
> make any difference?
I tried it. Here's the observation. Initially, the
script didn't eat so much RAM and it just stayed at
6604 MB for some time (atleast for 4 hours). I wanted
the script to run for more than a day. Next day, when
i did a 'top' in my RH Linux box, the mem. occupied
by the script was 8028 MB of RAM. Why the difference ?
May be, my test script wasn't a perfect one to check
for memory leaks in DBI or DBD::Pg. How can i create a
more efficient test script to check for memory leaks ?
Using the script, i should be able to find out any
memory leak, in about say 1 or 2 hours. Any thoughts ?
Also, i wanted to narrow down the problem, ie. whether
the problem is in DBI or DBD::Pg. Could anyone throw
some light on where should i start ? I can go by trial
& error method to find out but at the same time, i
feel there will be many guru's in this list who can
help me out.
Regards,
Guru Prasad.
--- Ian Barwick <barwick@gmx.net> wrote:
> On Wednesday 09 April 2003 06:58, Tom Lane wrote:
> > "P.N.Guru Prasad" <pnguruji@yahoo.com> writes:
> > > while (1) {
> > > print "sql executed and returned :",
> $Dbh->prepare("select user_id from
> > > users limit 1")->execute, "\n";
> > > }
> >
> > I'm not a DBI user, but I'd kinda expect that
> executing a query would
> > result in an object holding the results from that
> query. Don't you need
> > to do something to close/delete the result objects
> you're generating?
>
> Does
>
> while (1) {
> my $sth = $Dbh->prepare("select user_id from users
> limit 1");
> print "sql executed and returned :",
> $sth->execute, "\n";
> $sth->finish();
> }
>
> make any difference?
>
> If not try asking the dbi-users list,
> dbi-users@perl.org
> ( http://lists.perl.org/showlist.cgi?name=dbi-users
> )
>
> Ian Barwick
> barwick@gmx.net
>
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: pnguruji@yahoo.com, barwick@gmx.net
Subject: Re: Memory leak!!
In-Reply-To: <20030410143900.91502.qmail@web41505.mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox