Hello all.
I create small script, which download several files with 4-8 Mb size from ftp with Net::FTP module.
Running on Debian 7.5 it takes only 5 Mb memory. But on Windows 7 memory usage is 230 Mb! I try to test on another Windows 7 machine with latest version of perl and ftp-module, but it takes the same memory.
I want to know why this happens and how to reduce the memory usage?
use warnings; use feature 'say'; use Net::FTP; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $ftp = Net::FTP->new('mirror.ufs.ac.za', Debug => 0, Passive => 1, +BlockSize => 104857600); $ftp->login('anonymouse', 'anon@nymo.use'); $ftp->binary; $ftp->cwd('/applications/filezilla/FileZilla_Client/3.9.0.6/'); foreach my $line ($ftp->dir()) { eval { if ($line =~ /^(?<dir>[\-ld])(?<permission>([\-r][\-w][\-xs]){ +3})\s+(?<filecode>\d+)\s+(?<owner>\w+)\s+(?<group>\w+)\s+(?<size>\d+) +\s+(?<timestamp>((?<month>\w{3})\s+(?<day>\d{1,2})\s+(?<hour>\d{1,2}) +:(?<minute>\d{2}))|((?<month2>\w{3})\s+(?<day2>\d{1,2})\s+(?<year>\d{ +4})))\s+(?<name>.+)$/) { my %remote_file_info = %+; if ($remote_file_info{dir} eq '-') { if ($ftp->get($remote_file_info{name}, 'files/' . $rem +ote_file_info{name})) { } else { die($ftp->message); } } } }; if ($@) { say($@); } } $ftp->quit; undef($ftp);
In reply to Net::FTP memory usage in Windows by artem78
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |