From 64fb4effa7ec38d5069401c954a412aa3baab145 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 12 Jun 2019 11:08:19 +0100 Subject: [PATCH] docs: add FAQ entry about rclone using too much memory See: #2200 #1391 3196 --- docs/content/faq.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/content/faq.md b/docs/content/faq.md index b060bfe57..2e822948a 100644 --- a/docs/content/faq.md +++ b/docs/content/faq.md @@ -195,3 +195,19 @@ It is likely you have more than 10,000 files that need to be synced. By default rclone only gets 10,000 files ahead in a sync so as not to use up too much memory. You can change this default with the [--max-backlog](/docs/#max-backlog-n) flag. + +### Rclone is using too much memory or appears to have a memory leak + +Rclone is written in Go which uses a garbage collector. The default +settings for the garbage collector mean that it runs when the heap +size has doubled. + +However it is possible to tune the garbage collector to use less +memory by [setting GOGC](https://dave.cheney.net/tag/gogc) to a lower +value, say `export GOGC=20`. This will make the garbage collector +work harder, reducing memory size at the expense of CPU usage. + +The most common cause of rclone using lots of memory is a single +directory with thousands or millions of files in. Rclone has to load +this entirely into memory as rclone objects. Each Rclone object takes +0.5k-1k of memory.