From 4317b2169286b8a5b970942020f1a615ebcea321 Mon Sep 17 00:00:00 2001 From: Yuji Yaginuma Date: Sun, 19 Oct 2025 11:07:21 +0900 Subject: [PATCH] Mention the relation with `fs.inotify.max_user_watches` and the memory allocation When `fs.inotify.max_user_watches` is increased, memory allocation is also increased. This change adds a relation between them. This change was made based on the Visual Studio Code documentation. https://github.com/microsoft/vscode-docs/blob/1dc6fb1089cba238fb78a2e37ca3a4f4e68bdbdb/docs/setup/linux.md?plain=1#L290 Fixes #568. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 475062f8..1ba0e48b 100644 --- a/README.md +++ b/README.md @@ -353,6 +353,9 @@ $ sudo sysctl -p ``` You may also need to pay attention to the values of `max_queued_events` and `max_user_instances` if Listen keeps on complaining. +While 524,288 is the maximum number of files that can be watched. Each file watch [takes up 1,080 bytes](https://stackoverflow.com/a/7091897/1156119) on a 64-bit system, so assuming that all 524,288 watches are consumed, that allocates around 540 MiB. +If you're in an environment that is particularly memory-constrained, consider to specify a lower number. + #### More info Man page for [inotify(7)](https://linux.die.net/man/7/inotify). Blog post: [limit of inotify](https://blog.sorah.jp/2012/01/24/inotify-limitation).