mirror of
https://github.com/rclone/rclone.git
synced 2025-08-22 19:10:46 +02:00
sync: implement --list-cutoff to allow on disk sorting for reduced memory use
Before this change, rclone had to load an entire directory into RAM in order to sort it so it could be synced. With directories with millions of entries, this used too much memory. This fixes the probem by using an on disk sort when there are more than --list-cutoff entries in a directory. Fixes #7974
This commit is contained in:
@@ -277,6 +277,11 @@ var ConfigOptionsInfo = Options{{
|
||||
Default: false,
|
||||
Help: "Use recursive list if available; uses more memory but fewer transactions",
|
||||
Groups: "Listing",
|
||||
}, {
|
||||
Name: "list_cutoff",
|
||||
Default: 1_000_000,
|
||||
Help: "To save memory, sort directory listings on disk above this threshold",
|
||||
Groups: "Sync",
|
||||
}, {
|
||||
Name: "tpslimit",
|
||||
Default: 0.0,
|
||||
@@ -616,6 +621,7 @@ type ConfigInfo struct {
|
||||
Suffix string `config:"suffix"`
|
||||
SuffixKeepExtension bool `config:"suffix_keep_extension"`
|
||||
UseListR bool `config:"fast_list"`
|
||||
ListCutoff int `config:"list_cutoff"`
|
||||
BufferSize SizeSuffix `config:"buffer_size"`
|
||||
BwLimit BwTimetable `config:"bwlimit"`
|
||||
BwLimitFile BwTimetable `config:"bwlimit_file"`
|
||||
|
Reference in New Issue
Block a user