Newbie: optimizing my server's memory use (avoiding memory leaks)



Hi.

Using Perl v5.8.5 with DBI-1.47 on Linux.

I've developed some Perl scripts which are executed by crons and
handle data by using MySQL. I want to optimize my server's memory
use and would like to avoid and find memory leaks.

I use this code:
----------
$DB = DBI->connect ("DBI:mysql:database=$DBNAME:host=$DBHOST",
$DBUSER, $DBPASS)
or die "Can't connect to database:$DBI::errstr\n";
while(@r1 = $q1->fetchrow_array( )) {...}
$q1->finish;
$DB->disconnect;
---------

Must I compulsory close connections and free memory? Is there another way
to optimize memory use?

Thank you very much.
.



Relevant Pages

  • Re: Out of memory during request for 32 bytes
    ... Perl scripts? ... Out of memory during request for 32 bytes, ... the apache start up script for the limits args, login.conf for the user apache ...
    (freebsd-questions)
  • How to get memory usage for process?
    ... I need to figure out how much memory process really takes. ... For example, i am running 100 perl scripts, they are all the ... To unsubscribe, ...
    (freebsd-questions)
  • Re: How to get memory usage for process?
    ... Artem Koutchine wrote: ... > I need to figure out how much memory process really takes. ... > For example, i am running 100 perl scripts, they are all the ... relevant flags for the various memory segments that indicate memory ...
    (freebsd-questions)
  • Re: How to get memory usage for process?
    ... On Tue, 6 Apr 2004, Artem Koutchine wrote: ... > I need to figure out how much memory process really takes. ... > For example, i am running 100 perl scripts, they are all the ...
    (freebsd-questions)
  • Re: MySQL crashes on amd64
    ... >>1) Exchanging memory on the machine did not work. ... This is obviously not a hardware issue. ... The errors are reproducable for MySQL 4.1.15 and MySQL 5.0.15 so ... It is possible that mysqld could use up to ...
    (freebsd-current)