<div dir="ltr"><div>Hi,</div><div><br></div><div>When using rsync to back up the file system on my laptop, containing a pretty much default linux desktop, I was wondering how rsync uses over 100MB of RAM it allocates.</div><div><br></div><div>It turned out that most of the memory is used for the arrays of file_struct pointers, most of which end up unused - much more than the actual file_struct entries. In my case, the peak usage was 135MB of pointers, and just 1.5MB of the file_struct entries themselves.</div><div><br></div><div>The problem seems to be that the default file_list allocation parameters predate the incremental recursion, which allocates a huge number of small file lists, while AFAICS originally rsync allocated just one large list.</div><div><br></div><div>Applying the attached patch, which reduces the default allocation to 32 pointers, and preallocates 32K pointers only for the main file lists in send_file_list and recv_file_list, reduces the peak memory usage in my case from 142MB to 12MB.<br clear="all"><div><br></div><div>Regards,</div></div><div>--<br></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Jindřich Makovička</div></div>