Antivirus Impact on Build Speed

Some antivirus software can interfere with the IDE build process, causing builds to run dramatically slower. When you run a build in the IDE, many class files are created on your computer. If your antivirus software has real-time scanning enabled, the antivirus can force the build process to halt each time a file is created while the antivirus scans that file.

If you’re using Windows Defender, the IDE automatically checks whether you have real-time scanning enabled, and whether the scanning is configured to process directories where the IDE writes a lot of files.

The IDE offers you a possibility to exclude those directories from scanning automatically (this feature is available in 2019.2+ IDE versions).

If you prefer to perform the necessary configuration manually, you can do so by following these steps:

  • Click the Start button
  • Type “Windows Security”
  • Click on “Virus and threat protection”
  • Click on “Manage settings” under “Virus & threat protection settings”
  • Scroll down if needed, and then click on “Add or remove exclusions”
  • For every folder shown in the notification, press the + button, select “Folder” from the menu, and select the folder.

If you’re using a different anti-virus product, you may still be impacted by the problem, but there is no possibility to detect or correct this automatically. If you’re experiencing poor build performance, please follow the instructions of your anti-virus product to exclude the following directories from real-time scanning:

  • The directory of your project
  • The whole JetBrains directory for caches and settings: 
    Windows: 
    %APPDATA%\JetBrains
    %LOCALAPPDATA%\JetBrains
    Linux: 
     ~/.config/JetBrains
    ~/.cache/JetBrains
    macOS
    ~/Library/Application Support/JetBrains
    ~/Library/Caches/JetBrains

    Alternatively, you may add the directory used by an exact version of IDE to store settings and caches. It should be modified with every IDE update, though.
  • The Gradle cache directory (%USERPROFILE%\.gradle)

We also recommend excluding the IDE process from the antivirus to improve the startup performance.

Caution: To ensure that your computer is safe from malicious software, you should not completely disable real-time scanning or your antivirus software.

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.

783 out of 886 found this helpful
39 comments

> This only works if you have admin privileges on your computer, which is very rarely the case nowadays for company computers.

You should contact your IT/security team for assistance.

0

This only works if you have admin privileges on your computer, which is very rarely the case nowadays for company computers.

In my case, I ship an application with a custom run-time image, and I have to re-create it as part of the build every-time a new module needs to be added to the jre. That build takes forever, because I have no admin rights to configure the exclusions.

Are there plans to assess the feasibility of implementing a different workaround in the future?

0

Hello, I have applied for my plugin for a long time and multiple times, but it has not been approved. Can you please inform me of the reason?

0

I this really a good idea? I mean If I were a malware developer, I would just have my droppers look e.g. for a .gradle folder, and deploy and execute the actual malware there. How can you put performance above IT security, especially in the enterprise context?

0

Our company security team is referring to following article to configure antivirus whitelist: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519

Can you tell me whether there is performance impact if not entire %APPDATA%\JetBrains is trusted, but only directories under %APPDATA%\JetBrains\IntellijIDEA*? Also should this article be treated as a source of truth for Microsoft Defender configuration company-wide?

0

A bit unrelated: Learned so much, switching from EclipsePDT to PHPStorm - amazing! THX.

 

0

This sounds like a very useful idea, but is it literally only for Windows Defender?

What if any one of a multitude of other antivirus packages are installed? For example, we have McAffee On-Access scanning. Will the options available in 2019.2 help in that instance?

If not, what is the recommended course of action? I need a clear statement on this that I can take to the IT Security department to detail exactly why on access scanning for certain files or folders should be switched off. Are you able to list the folders that this setting stops from scanning?

0
Avatar
Permanently deleted user

Serge Baranov Is there a way to disable this Build Speed check?

Our company has a strict antivirus policy, so we cannot disable Defender.  So we just want to disable the PowerShell.exe from being executed, because it is getting flagged every time a project is opened.

0

Please sign in to leave a comment.

Have more questions?

Submit a request