Skip to content

Commit f4edc99

Browse files
j-futimholy
andauthored
Update band-aid info on file watching (#778) (#779)
Co-authored-by: Tim Holy <[email protected]>
1 parent 7e6f58b commit f4edc99

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

docs/src/config.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -123,25 +123,37 @@ string `"1"` (e.g., `JULIA_REVISE_INCLUDE=1` in a bash script).
123123
Revise needs to be notified by your filesystem about changes to your code,
124124
which means that the files that define your modules need to be watched for updates.
125125
Some systems impose limits on the number of files and directories that can be
126-
watched simultaneously; if this limit is hit, on Linux this can result in a fairly cryptic
127-
error like
126+
watched simultaneously; if such a limit is hit, on Linux this can result in Revise silently ceasing to work
127+
(albeit with unit tests failing) or in a fairly cryptic error like
128128

129129
```sh
130130
ERROR: start_watching (File Monitor): no space left on device (ENOSPC)
131131
```
132132

133-
The cure is to increase the number of files that can be watched, by executing
133+
The cure is to investigate and possibly increase the number of files that can be watched.
134134

135+
Invoking
135136
```sh
136-
echo 65536 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
137+
$ sysctl fs.inotify
137138
```
139+
at the linux prompt may e.g. result in
140+
```
141+
fs.inotify.max_queued_events = 16384
142+
fs.inotify.max_user_instances = 128
143+
fs.inotify.max_user_watches = 524288
144+
```
145+
146+
For Revise usage, `max_user_watches >= 65536` is recommended, and more can be helpful; the value of 524288 above is common on modern systems. One can set higher values as needed, e.g.,
147+
```
148+
$ sudo sysctl fs.inotify.max_user_instances=2048
149+
```
150+
After changing these values, it is advised to run Revise's unit tests to see if they pass.
151+
152+
This change can be made [permanent](https://www.suse.com/de-de/support/kb/doc/?id=000020048).
138153

139-
at the Linux prompt. (The maximum value is 524288,
140-
which will allocate half a gigabyte of RAM to file-watching).
141-
For more information see [issue #26](https://github.com/timholy/Revise.jl/issues/26).
154+
For more information see issues [#26](https://github.com/timholy/Revise.jl/issues/26)
155+
and [#778](https://github.com/timholy/Revise.jl/issues/778).
142156

143-
Changing the value this way may not last through the next reboot,
144-
but [you can also change it permanently](https://askubuntu.com/questions/716431/inotify-max-user-watches-value-resets-on-reboot-how-to-change-it-permanently).
145157

146158
### Polling and NFS-mounted code directories: JULIA\_REVISE\_POLL
147159

0 commit comments

Comments
 (0)