X-Original-To: pgsql-interfaces@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EFF26475AE5 for ; Thu, 10 Apr 2003 10:38:56 -0400 (EDT) Received: from web41505.mail.yahoo.com (web41505.mail.yahoo.com [66.218.93.88]) by postgresql.org (Postfix) with SMTP id C36CB474E42 for ; Thu, 10 Apr 2003 10:38:55 -0400 (EDT) Message-ID: <20030410143900.91502.qmail@web41505.mail.yahoo.com> Received: from [61.3.64.6] by web41505.mail.yahoo.com via HTTP; Thu, 10 Apr 2003 07:39:00 PDT Date: Thu, 10 Apr 2003 07:39:00 -0700 (PDT) From: guru prasad Subject: Re: Memory leak!! To: pgsql-interfaces@postgresql.org Cc: Ian Barwick In-Reply-To: <200304090838.09883.barwick@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Status: No, hits=-16.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/105 X-Sequence-Number: 4044 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 wrote: > On Wednesday 09 April 2003 06:58, Tom Lane wrote: > > "P.N.Guru Prasad" 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