Re: Memory leak!!

From: guru prasad <pnguruji(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: Ian Barwick <barwick(at)gmx(dot)net>
Subject: Re: Memory leak!!
Date: 2003-04-10 14:39:00
Message-ID: 20030410143900.91502.qmail@web41505.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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(at)gmx(dot)net> wrote:
> On Wednesday 09 April 2003 06:58, Tom Lane wrote:
> > "P.N.Guru Prasad" <pnguruji(at)yahoo(dot)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(at)perl(dot)org
> ( http://lists.perl.org/showlist.cgi?name=dbi-users
> )
>
> Ian Barwick
> barwick(at)gmx(dot)net
>

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Steve Crawford 2003-04-10 15:55:01 Re: More thoughts about FE/BE protocol
Previous Message Tom Lane 2003-04-10 13:57:41 Re: More thoughts about FE/BE protocol