Subject: | out of memory in scp_get and scp_put |
Net-SSH2-0.08
perl 5.8.0
Fedora Code 4 (2.6.13-SMP)
I'm found it impossible to scp_put and scp_get large files. Getting or
putting files with size about 3Gb or so leads to "out of memory" error.
In scp_get code tries to read all the channel data at once
my $count = $chan->read($buf, $stat{size});
In scp_put code tries to read the whole file at once
my $count = $file->sysread($buf, $stat[7]);
Even if you don't get "out of memory" error when dealing with smaller
files, the code holds all the data in memory.
The simpliest and suppose the only way to fix it is to read and write
data repeatedly by small chunks.
Hope it will be fixed soon.
Thanks.