Subject: Memory Leak with Perl & Mysql
Date: Sun, 23 May 1999 13:35:37 PDT
From: "SuratSingh Bhati" <sura...@hotmail.com>
To: msql...@lists.mysql.com
Hi ,
I am using Perl & Mysql on my digital alpha m/c.
Web server is Netscape Enterprise Server 3.6.
This site having about 100000 hits per hour,
But my server become slow after 2-3 hour , and
I have to restart it,
My unix admin syas this is due to memory leak , that may
be due to coding of my CGI program,
How I can check the memory leak of my program?
How should I remove it?
That's a difficult problem, in particular for newbies as you seem
to be. (Sorry!)
I typically create sample input data and let the script run not only
once, but repeatedly. Then I watch the dize of the process. If it grows
permanently, there's a memory leak. (In most cases in your code and not
in Perl, MySQL or DBD::mysql.) For an example see the script t/60leaktest
from the Msql-Mysql-modules distribution.
Another idea is using a helper module like Devel::Leak, but understanding
that module requires a little bit knowledge of Perl's garbage collection.
On the other hand, garbage collection is the most evident reason for
memory leaks, so you probably need that anyways. :-)
Bye,
Jochen