withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.05k stars 63 forks source link

High CPU usage while idle #1794

Open andreialecu opened 2 years ago

andreialecu commented 2 years ago

Sanity checks

Issue Details

I noticed high CPU usage from fig recently:

image

Tweeted about it and got a message saying to run fig doctor. I ran it and got this:

image

After running it, the cpu usage went down automatically. I'm not sure if it's because the doctor restarted fig, probably did.

It seems to be fixed now. But it used to come back randomly.

Environment

fig-details:
  - desktop-version: Version 1.0.61 (B526) [ABC]
hardware-info:
  - model: MacBook Pro
  - model-id: MacBookPro18,4
  - chip-id: Apple M1 Max
  - cores: 10 (8 performance and 2 efficiency)
  - mem: 64 GB
os-info:
  - macOS 12.6.0 (21G115)
environment:
  - shell: /bin/zsh
  - terminal: iterm
  - cwd: /Users/andreialecu/Work/contrib/fastify-disablecache
  - exe-path: /Users/andreialecu/.local/bin/fig
  - install-method: unknown
  - env-vars:
    - FIG_INTEGRATION_VERSION: 8
    - FIG_TERM: 1
    - FIG_TERM_VERSION: 5.2.0
    - PATH: /Users/andreialecu/.local/bin:/opt/homebrew/opt/libpq/bin:/Applications/Android Studio.app/Contents/jre/Contents/Home//bin:/Applications/Android Studio.app/Contents/jre/Contents/Home//lib:/Users/andreialecu/Library/Android/sdk/tools:/Users/andreialecu/Library/Android/sdk/platform-tools:/Users/andreialecu/.rbenv/shims:/Users/andreialecu/.nvm/versions/node/v16.14.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Users/andreialecu/.fig/bin:/Users/andreialecu/.local/bin:/Users/andreialecu/.antigen/bundles/robbyrussell/oh-my-zsh/lib:/Users/andreialecu/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/git:/Users/andreialecu/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/command-not-found:/Users/andreialecu/.antigen/bundles/robbyrussell/oh-my-zsh/plugins/docker:/Users/andreialecu/.antigen/bundles/zsh-users/zsh-completions:/Users/andreialecu/.antigen/bundles/zsh-users/zsh-autosuggestions:/Users/andreialecu/.antigen/bundles/zsh-users/zsh-syntax-highlighting:/Users/andreialecu/.antigen/bundles/denysdovhan/spaceship-prompt:/Users/andreialecu/.antigen/bundles/agkozak/zsh-z:/Users/andreialecu/.antigen/bundles/lukechilds/zsh-nvm
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - TERM_SESSION_ID: w0t0p0:0937142C-975A-4148-BA1A-36753F25A68A
    - FIG_PID: 7135
- integrations:
  - SSH: false
  - TMUX: false
  - iTerm: installed!
  - Hyper: application is not present.
  - Visual Studio Code: installed!
  - Docker: false
andreialecu commented 2 years ago

Possibly related: https://github.com/withfig/fig/issues/1369

mschrage commented 2 years ago

Where do you have the Fig.app installed and how did you install it?

andreialecu commented 2 years ago

I don't really remember how I installed it. Had it for a long time.

➜ where fig
/Users/andreialecu/.local/bin/fig
/usr/local/bin/fig
/Users/andreialecu/.fig/bin/fig
/Users/andreialecu/.local/bin/fig

Does this help?

andreialecu commented 2 years ago

It's not installed via homebrew, I don't see it in brew list. So it must've been via the .dmg file, before the homebrew formulae got created (I don't remember there being one)

andreialecu commented 2 years ago

What is fig-darwin-universal though? I don't see it running now.

mschrage commented 2 years ago

fig-darwin-universal is the internal name for the CLI/daemon (those other values are symlinks).

Can you run ls /Applications | grep Fig?

andreialecu commented 2 years ago
➜ ls /Applications | grep Fig
Fig.app
Figma.app
mschrage commented 2 years ago

If you run fig restart daemon, does the CPU usage reset?

andreialecu commented 2 years ago

After fig doctor made those fixes, I haven't seen this reoccur.

I also haven't seen fig-darwin-universal running at all anymore. It's just reported as fig.

So I believe fig-darwin-universal running may serve as a clue as to what was wrong here.

If relevant, while this was occurring, I found that I was logged out for some reason. When I initially ran fig doctor it asked me to fig login.

ghost commented 1 year ago
Screen Shot 2023-08-07 at 9 18 22 am

Still an issue. Intel mac, OSX 12.6.8. Fresh install using brew, fig doctor says everything is fine. Uninstalled and will try another time since this was first opened Sept 2022, but never looked in to, now almost a year later.