Skip to content

Commit 4317b21

Browse files
committed
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.
1 parent cde3720 commit 4317b21

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@ $ sudo sysctl -p
353353
```
354354
You may also need to pay attention to the values of `max_queued_events` and `max_user_instances` if Listen keeps on complaining.
355355

356+
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.
357+
If you're in an environment that is particularly memory-constrained, consider to specify a lower number.
358+
356359
#### More info
357360
Man page for [inotify(7)](https://linux.die.net/man/7/inotify).
358361
Blog post: [limit of inotify](https://blog.sorah.jp/2012/01/24/inotify-limitation).

0 commit comments

Comments
 (0)