2

Operations with git take very long time making git unusable.

For example, when one does git pull (to update local repo to master repo) Antimalware Service Executable eats close to 90% of the CPU and it takes too long to complete the git pull operation.


High CPU usage after git pull


Here are execution time measurements of some other git commands:

$ git status
...
7m31s

$ git stash save "xxx"
Saved working directory and index state On xxx: xxx
24m26s

$ git stash list
stash@{0}: xxx
23.9s

Software versions:

OS: Windows 10 Pro (Version 10.0.18362 Build 18362).

$ /usr/bin/git --version
git version 2.21.0

As for ssh I have (at least) two ssh installed. I do not know yet which one (if any) is used by git:

$ /bin/ssh -V
OpenSSH_8.2p1, OpenSSL 1.1.1f  31 Mar 2020

$ /cygdrive/c/Windows/System32/OpenSSH/ssh -V
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5

What's the problem? How to solve?

UPD. I've already tried to stop (at least temporarily) Antimalware Service Executable, but Windows 10 does not allow to do that even if one has Administrator permissions.

Cannot stop Antimalware Service Executable:

enter image description here

UPD1. As @harrymc has suggested, I've added path to folder to git repo via the Add or remove exclusions option. The git operations have became faster, but Antimalware Service Executable is still shows up during git operations and eats close to 50% of the CPU. Is this behavior of the Antimalware Service Executable considered normal?

High CPU usage after path to git repo was excluded from the ASE

3
  • Don't use Antimalware?
    – DavidPostill
    Apr 22, 2020 at 19:27
  • @DavidPostill, it seems that Windows 10 uses it by default. I've tried to stop it (see UPD section), but without success till the moment.
    – pmor
    Apr 22, 2020 at 19:35
  • So exclude your git source directory. Windows Defender , go to Settings > Excluded files and locations.
    – DavidPostill
    Apr 22, 2020 at 19:38

1 Answer 1

1

The Antimalware Service Executable (the MsMpEng.exe) process is Windows Defender’s background service and it is always running in the background. This process enables Windows Defender to monitor potential threats to your computer and provide real-time protection against malware.

If it fails on some folders, the only solution is to exclude these folders from real-time protection. Here is how:

  • Go to Settings > Update & Security > Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions

  • Click "Add an exclusion"

  • Choose folder and add the Git folder or any other problematic folder.

6
  • Thanks for the quick answer! Please see my UPD1.
    – pmor
    Apr 22, 2020 at 20:35
  • There are more folders to exclude. Try perhaps Process Explorer run as admin to view the folders used by MsMpEng.exe.
    – harrymc
    Apr 22, 2020 at 20:39
  • Yes, thanks, I know about Process Explorer (however, have never used it in advanced mode). I've found MsMpEng.exe process via Find => Find Handle or DLL. How then view the folders used by MsMpEng.exe?
    – pmor
    Apr 22, 2020 at 21:14
  • Use menu View > Show Lower Pane and Lower Pane View > Handles, sort by Type and scroll down to Directory types or perhaps File.
    – harrymc
    Apr 23, 2020 at 6:35
  • Thanks! Now I see several folders used by MsMpEng.exe. For example KnownDlls, BaseNamedObjects, etc. And the question is: what should I do with these folders used by MsMpEng.exe? (Btw, I've added also C:\cygwin64\bin and C:\Windows\System32\OpenSSH to the list of exclusions. Just to be sure.)
    – pmor
    Apr 27, 2020 at 19:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .