From: yitzle <[EMAIL PROTECTED]> > Hi. > I've got two scripts I am running and they both consume large amounts > of memory (10MB). > How would I go about finding where the memory is being used and > figuring out how to reduce the memory footprint. > > Both scripts start off with: > > #!/usr/bin/perl > use warnings; > use strict; > use WWW::Mechanize; > use HTTP::Cookies; > use Term::ReadKey; > > Would removing a "use" help? I can disable strict and warnings while > not editing the script. And Term::ReadKey isn't really needed.
use strict and use warnings will not make a big difference and removing them is definitely not worth it. > Is it possible that Mechanize is using a really large amount of RAM? I > set the stack_depth to 1. Of course it is. Especially if the page(s) are big. The module has to parse the HTML and the resulting structure may be quite big. And really ... I would not call 10MB a large amount of memory nowadays. Jenda ===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz ===== When it comes to wine, women and song, wizards are allowed to get drunk and croon as much as they like. -- Terry Pratchett in Sourcery -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/