I have a Perl script, fetch url like http://1.1.1.1/1.jpg
from MySQL using DBI, and download this jpg file using LWP::Simple. It's a infinite loop.
while (1) {
my $url=&fetch_url_from_mysql;
if ($url){
&download_jpg($url);
} else {
sleep 1;
}
}
Plain simple. I suppose the memory usage would be stay in certain amount. But after one month of continuous running of this script. The memory usage is 7.5G!
How can I profile it?