A lot of libraries (Ruby and elsewhere) handle large files rather naively. 
Fortunately, Net::SFTP looks like it has some smarts for this. The docs for 
Session#download! say: "If local [the second argument] is omitted, 
downloads the file to an in-memory buffer and returns the result as a 
string; otherwise, returns the Net::SFTP::Operations::Download instance." 
The next place to look is at 
Download: 
http://net-ssh.github.io/net-sftp/classes/Net/SFTP/Operations/Download.html. 
It looks like you've already been there though, because you're using the 
event handler. The file is written as the download progresses, so it 
doesn't look like it's cramming the whole thing in memory. I also watched 
memory usage while downloading a large file, and the ruby process stays 
around 30 MB, so I don't think it's an issue related to in-memory buffering.

I'm still digging to see if I can find a reason why it would hang at 4 GB.

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to