This project is read-only.

.OpenRead and memory (RAM) usage

Oct 30, 2015 at 7:49 AM
Edited Oct 30, 2015 at 8:14 AM
Hello
first of all thank you for this wonderful tool.

I am using it for a backup tool from a few servers at once, so lets say for the example that there are 10 instances of ftpClient, each doing .openRead on a 1 GB file.

as I see when trying with 2 clients, the RAM usage is equal to the files being read (2 GB)? so i need 10GB ram for this task?
is there a way around it? it is using a buffer, can we also buffer the RAM usage?

thanks!
Oct 30, 2015 at 11:03 AM
just for others hitting this wall, here is the solution:

I used a code sample from: http://www.schiffhauer.com/downloading-a-file-from-ftp-with-system-net-ftpclient/

it passes the wrong buffer size in line:
using (var fileStream = File.Create(destinationPath , (int)ftpStream.Length))

it passes the entire file size instead of (8 * 1024) for example.

once i caught it the problem went away.

I tried letting the blog owner know but it didn't work so i am posting it here so maybe others find it.


again - thank you for this wonderful tool.