Skip to content

Internal git process periodically using ~100% CPU usage on macOS #10171

Closed

Description

@ericdrobinson

Describe the feature or problem you’d like to solve

I am running GitHub Desktop 2.5.3 on a 2018 MacBook Pro running macOS 10.14.6. Recently, I've noticed that my computer's fans turn on periodically. When I investigated, I found that GitHub's internal git process would eat ~100% CPU (equivalent of one core) for roughly 1-2 minutes.

Proposed solution

Determine what git is doing in the background and either stop it or otherwise message what it's doing in the UI.

Additional context

Here is a screenshot depicting the issue:
image

Activity

  1. added
    more-info-needed
    on Jul 8, 2020
  2. tierninho commented on Jul 8, 2020

    @tierninho
    Contributor

    @ericdrobinson Thanks for the report. Please upload your logs from the day this happened -- see the Help menu in Desktop -- so one of our developers can take a look.

    Ref: #9969, #9901, #9662, #9675, #7955, #7610, #5789, #5226 as we have a few reports of similar issues.

  3. ericdrobinson commented on Jul 9, 2020

    @ericdrobinson
    Author

    @tierninho Hah! It happens every day (and night) so I'll just post the latest log. See:

    2020-07-09.desktop.production.log

    The issue happened again right before I grabbed this log. The last few lines are probably the most relevant.

    Also, of all of the other issues you listed (thanks!), I think the closest looked like #7955 but I suspect it's unrelated as the referenced background process takes merely ~14-30s which I believe is only a fraction of the time that the internal git process sits at that ~100% CPU utilization...

  4. Holfz commented on Jul 9, 2020

    @Holfz

    Can confirmed this happens on windows too. I've got like ~68-100 CPU usage when trying to commit the change
    87097707-f96c3c80-c26f-11ea-9b4d-d57674aea3c0

    It's pushed the change to repo but desktop stuck at Fetching origin and start to affect the CPU usage.
    Capture

    Here is the log files :
    2020-07-09.desktop.production.log

  5. ptzkoke3 commented on Jul 10, 2020

    @ptzkoke3
  6. ptzkoke3 commented on Jul 10, 2020

    @ptzkoke3
  7. 1bertor commented on Aug 26, 2020

    @1bertor

    It´s happening for me on PC some for some days now.
    I cant pull, refresh or any operation without CPU going to 100% and the operation doesn´t work even if I wait an hour.
    Only way to really get CPU usage down again is using task manager to finish Git there.
    i9 - 0080HK CPU - 64Gb RAM here.

  8. UebelAndre commented on Sep 20, 2020

    @UebelAndre

    This is happening to me as well. Does anyone know if this is an upstream issue?

  9. ericdrobinson commented on Sep 29, 2020

    @ericdrobinson
    Author

    My understanding (guess?) is that these random 100% CPU usage spikes are due to a whole bunch of git status processes running in the background to update the Repository Status Indicators.

    Yesterday's update of GitHub Desktop to v2.5.6 included this little nugget:

    Periodic background fetch and status updates can now be disabled in the Advanced section of Preferences/Options - #10593

    Disabling this feature via the new option may help cut down on the periodic 100% CPU usage issue. I have made the change myself and will keep an eye on whether the problem persists or not.

  10. steveward commented on Oct 20, 2020

    @steveward
    Contributor

    @ericdrobinson I'm going to close this out since we are tracking these CPU issues in #10625. Please let us know if disabling background fetching helped improve things for you.

  11. removed
    more-info-needed
    on Oct 20, 2020
  12. ericdrobinson commented on Oct 20, 2020

    @ericdrobinson
    Author

    @steveward Understood, thanks!

    Please let us know if disabling background fetching helped improve things for you.

    Disabling background fetching does appear to have improved things for me.

    As an experiential note, the background git process would consume ~100% of a logical CPU core when active and last somewhere between 30-60 seconds. As I am on a laptop (2018 15" MacBook Pro) with multiple external monitors connected¹, the additional heat from this process would typically cause the fans to spool up to 100%. In warmer operating environments (read: summer), this would also drive up the frequency with which kernel_task CPU floods occurred, causing the computer to grind to a painful halt in the middle of standard work.

    ¹ The multiple monitors are important because of the effect that some connections to external monitors have on power draw. This gets pretty technical, but the short of it is that the GPU has to synchronize display timings between external monitors and the built-in panel (e.g. with laptops), and if an efficient cross-monitor configuration cannot be found, the display driver will simply run the GPU at maximum power draw to compensate. This additional power production will reduce the amount of thermal headroom typically provided to the CPU. In short, people with laptops using external monitors may be more severely affected by (or otherwise notice) the sudden burst of CPU draw from the background process.

    I hope this is helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions