Overview
Some antivirus software can significantly slow down your IDE’s build process. This typically happens when real-time scanning is enabled, which causes the antivirus to scan each file as it’s created during the build. As a result, the build can pause repeatedly, leading to degraded performance.
Windows Defender: detection and configuration
If you're using Windows Defender, the IDE helps by automatically checking whether real-time scanning is active and whether it’s scanning directories that are frequently written to during builds.
Since version 2019.2, the IDE can automatically exclude these directories to avoid performance issues. You’ll be prompted when this is necessary.
Manual configuration
If you prefer to configure exclusions yourself, you can do so manually:
- Open the Start menu and type “Windows Security”.
- Select Virus & threat protection.
- Under Virus & threat protection settings, click Manage settings.
- Scroll down and click Add or remove exclusions.
- For each folder shown in the IDE notification, click Add an exclusion, choose Folder, and select the appropriate path.
Other antivirus software
If you’re using a different antivirus product, the IDE cannot automatically detect or configure exclusions. However, real-time scanning may still interfere with build performance.
In that case, you should manually exclude certain directories using your antivirus software’s settings.
Recommended directories to exclude:
- The project directory you're building.
- JetBrains system directories, which store settings and caches.
On Windows:
%APPDATA%\JetBrains
%LOCALAPPDATA%\JetBrains
On Linux:
~/.config/JetBrains
~/.cache/JetBrains
On macOS:
~/Library/Application Support/JetBrains
~/Library/Caches/JetBrains
You can also exclude the Gradle cache directory at:
%USERPROFILE%\.gradle
Optionally, you may add IDE version-specific cache directories, though these will need updating each time you upgrade the IDE.
Improving startup performance
To further enhance startup performance, consider excluding the IDE process itself from antivirus scanning. Consult your antivirus software documentation to add an application-level exclusion.
⚠️ Caution: While optimizing performance is important, you should not disable your antivirus software entirely, nor should you turn off real-time scanning globally. Doing so would expose your system to unnecessary risks.
💡 Note: IDE runs powershell.exe process to detect if Windows Defender is active and to exclude the folders from the antivirus. This may trigger suspicious activity detection by some other antivirus tools like TrendMicro. This behavior is by design and the corresponding source code can be found on GitHub. It's safe to permit running PowerShell from the IDE.
Comments
0 comments
Please sign in to leave a comment.