# Introducing file system watching

DevFeed: [Introducing file system watching](<https://devfeed.tech/articles/introducing-file-system-watching-24651.md>)

Original publisher: [Read original article](<https://blog.gradle.org/introducing-file-system-watching>)

Author: Stefan Wolf

Published: 2020-05-29T04:00:00Z

Content type: article

Language: en

Sources: [The Gradle Blog](<https://devfeed.tech/sources/the-gradle-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [build performance](<https://devfeed.tech/topics/build-performance.md>), [Filesystems](<https://devfeed.tech/topics/filesystems.md>), [build times](<https://devfeed.tech/topics/build-times.md>), [Development](<https://devfeed.tech/topics/development.md>), [Linux](<https://devfeed.tech/topics/linux.md>), [macOS](<https://devfeed.tech/topics/macos.md>), [Windows](<https://devfeed.tech/topics/windows.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [build](<https://devfeed.tech/tags/build.md>), [build-tool](<https://devfeed.tech/tags/build-tool.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [files](<https://devfeed.tech/tags/files.md>), [incremental](<https://devfeed.tech/tags/incremental.md>), [linux](<https://devfeed.tech/tags/linux.md>), [logging](<https://devfeed.tech/tags/logging.md>), [macos](<https://devfeed.tech/tags/macos.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

This article introduces Gradle file system watching, a feature that improves incremental build performance by retaining file system information in memory between builds. It reduces disk I/O by receiving operating system notifications about changes and reusing cached information for unchanged locations. The feature supports recent versions of Linux, macOS, and Windows and became production-ready in Gradle 6.7.

## Source excerpt

This is the first installment in a series of blog posts about incremental development-the part of the software development process where you make frequent small changes. We will be discussing upcoming Gradle build tool features that significantly improve feedback time around this use case. This blog post has been updated after the feature has become production-ready in Gradle 6.7. In Gradle 6.5, we have introduced an experimental feature called file system watching that significantly accelerates incremental builds. When enabled, it allows Gradle to keep what it has learned about the file system in memory between builds instead of polling the file system on each build. This significantly reduces the amount of disk I/O needed to determine what has changed since the previous build. Since Gradle 6.7 this feature is ready for production use. We are planning to enable the feature by default in a later release. How does it work? In order to determine whether Gradle needs to execute a task, it needs to check if any of its input and output files have changed since the last build. The daemon stores this information about the file system till the end of the current build in memory in what we call the virtual file system. Without file system watching, the daemon does not know what happens to the file system in-between builds, and therefore it must discard all the collected information about the file system at the end of each build. When file system watching is enabled, the daemon instructs the operating system to notify it about changes on disk. Since the daemon knows what changed since the previous build, it can re-use the information in the virtual file system for all the unchanged locations, avoiding unnecessary disk I/O. Gradle ships with the necessary integration for the recent versions of Linux, macOS, and Windows. Other operating systems are not supported. File system watching in action You can enable file system watching by passing the command line switch --watch-fs or