By the looks of it, openrsync does attempt to map the entire file, from
usr.bin/rsync/uploader.c:

    mapsz = st.st_size;
    map = mmap(NULL, mapsz, PROT_READ, MAP_SHARED, *fileinfd, 0);

The likely reason for your out of memory error is the default datasize
in login.conf. IIRC on some arches it's set to 768MB by default, which
would allow your 300MB file to transfer, but would cause mmap to fail
upon attempting to map the 1.6GB one.

Increasing the default limits in /etc/login.conf should fix the problem.

Note that rsync (not openrsync), doesn't use mmap for other reasons,
from rsync-3.1.3/fileio.c:

/* This provides functionality somewhat similar to mmap() but using read().
 * It gives sliding window access to a file.  mmap() is not used because of
 * the possibility of another program (such as a mailer) truncating the
 * file thus giving us a SIGBUS. */

Cheers,
Joe

Reply via email to