Indexing is triggered through inotify on Linux.
There is a limit to the number of directories that one user can set on a watch. If your project is large, then this limit can be exceeded, and Android Studio returns to the recursive scan mode, which is very slow.
To fix this, add this line to /etc/sysctl.conf file :
# Increase the limit for Android Studio `fs.inotify.max_user_watches = 500000`
Then run sudo sysctl -p .
Sun Jun. 19 '15 at 0:01 2015-06-19 00:01
source share