# Net::SFTP transferring 200mb+ file problems

**URL:** <https://www.ruby-forum.com/t/net-sftp-transferring-200mb-file-problems/82117>\
**Category:** Ruby\
**Created:** [January 17, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/net-sftp-transferring-200mb-file-problems/82117 "2007-01-17T16:19:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 17, 2007, 4:19pm UTC](https://www.ruby-forum.com/t/net-sftp-transferring-200mb-file-problems/82117/1 "2007-01-17T16:19:02Z")

</div>

Hi,  
I’m using the Net::SSH and Net::SFTP gems.

One part of my application transfers a very large file (200-300mb) via  
sftp. When this file get’s transferred, I notice that the memory usage  
balloons to 400M!

Is this normal?!

My code is very straightforward:

I call the put\_file method:

ie:

sftp.put\_file src, dest

Thanks,  
John.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 17, 2007, 10:59pm UTC](https://www.ruby-forum.com/t/net-sftp-transferring-200mb-file-problems/82117/2 "2007-01-17T22:59:47Z")

</div>

Hello,

Net::SFTP loads the whole file in memory. Take a look at this:  
[http://www.elpauer.org/index.php?p=213](http://www.elpauer.org/index.php?p=213)

A fix is needed but the author says he has no time.

–  
Pau Garcia i Quiles  
[http://www.elpauer.org](http://www.elpauer.org)  
(Due to the amount of work, I usually need 10 days to answer)

Quoting John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
