Skip to content

Hard CPU pressure on background. #102

Closed

Description

@vng
  • Build latest master.
  • Open any repo.
  • Switch to code editor and edit any file from the repo with saving. GitX starts some activity that pressure all available cores.

Activity

  1. robinwhittleton commented on Sep 29, 2017

    @robinwhittleton

    I’ve noticed this too, although I put it down to the fact that I had multiple 1mb unmerged epubs sitting in the repo.

  2. beporter commented on Oct 9, 2017

    @beporter

    For me the CPU spikes when I start running my phpunit test suite against the checked out repo. Bringing GitX to the front momentarily seems to resolve the issue until the next test suite run. I can usually tell this is happening because it's the only time the fan in my MacBook turns on. 😞

  3. tiennou commented on Oct 9, 2017

    @tiennou
    Contributor

    Sorry, I don't remember whether something related to how GitX run command-line tasks has been merged yet or not (I think not), but if my memory isn't faulty, you guys are running with the "Automatic refresh" thingy enabled (see GitX preferences), and it can cause major issues when 1) there's major filesystem churn going on 2) you use git to perform rebases (because locking).

    It's actually best to disable it and manually refresh (⌘R) when switching to GitX.

  4. vng commented on Oct 11, 2017

    @vng
    ContributorAuthor

    @tiennou If you mean "Watch for changes in repositories", this option is off for me, but the problem still exists. I didn't find any other "Automatic refresh" option.

  5. mangerlahn commented on Dec 1, 2017

    @mangerlahn
    Contributor

    I think I found the issue.

    The addition of

    fileHandle.readabilityHandler = ^(NSFileHandle * _Nonnull fileHandle) {
    	[dataOutput appendData:fileHandle.availableData];
    };
    

    in 7057740 causes the CPU load. If I comment this section out, the issue is gone (for me!)..

    The lines can be found in - (void)setDataOutput:(nonnull NSMutableData *)dataOutput; of PBEasyPipe.

    I don't know what the codes purpose is, but I am sure removing it is not the solution 😅

  6. mangerlahn commented on Dec 1, 2017

    @mangerlahn
    Contributor

    Maybe @claybridges can help?

  7. tiennou commented on Dec 2, 2017

    @tiennou
    Contributor

    Might be caused by this. Does adding [self.fileHandleForReading closeFile] to that -clear method makes it go away ? I suspect there's a retain loop somewhere, which would cause the task to linger, causing the pipe to not be closed.

  8. added a commit that references this issue on Dec 2, 2017
    4a894d4
  9. mangerlahn commented on Dec 2, 2017

    @mangerlahn
    Contributor

    You were right! Closing the handle relaxes the situation.. Thanks!

  10. mitisBlack commented on Jan 29, 2018

    @mitisBlack

    @tiennou the fix for this is not quite correct. See the second answer on the stackoverflow link. If the file is not complete (or read completely), the sub-process will fail with a SIGPIPE abort. I can reproduce this easily when attempting to amend a patch with many changed files (eg: updated smth across all .h files in a project).

  11. robinwhittleton commented on Jan 29, 2018

    @robinwhittleton

    Thanks for the diagnosis @mitisBlack. GitX has definitely been quite explosive for me since this merge. For example, I had to give up using GitX and switch to Fork to review the changes in this commit yesterday: robinwhittleton/herman-melville_moby-dick@26af223. Feel free to clone the repo and soft reset to try to replicate if you want.

  12. tiennou commented on Feb 5, 2018

    @tiennou
    Contributor

    Just pushed a fix to master for the 2nd part, and checked that the Moby Dick repo works (thanks for that @robinwhittleton, that's a pretty helpful test case 😉).

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