New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atom Helper high CPU usage #3426

Closed
LukeMauldin opened this Issue Aug 29, 2014 · 123 comments

Comments

Projects
None yet
@LukeMauldin
Copy link

LukeMauldin commented Aug 29, 2014

Since upgrading to 0.123 (or maybe 0.124) I have been experiencing very high CPU usage from Atom Helper. Running on Macbook Pro with OSX 10.9.4. Have been using Atom for several months and have not experienced this problem before. Unsure how to troubleshoot more.

@izuzak izuzak added the performance label Aug 31, 2014

@izuzak

This comment has been minimized.

Copy link
Member

izuzak commented Aug 31, 2014

Thanks for reporting this @LukeMauldin. Just to make sure this isn't caused by a package you might have installed -- could you please try running Atom in safe mode and see if that helps? Also, is there anything in you init.coffee file which might be causing this?

What's the CPU usage when you observe this? Also, does this happen as soon as you start Atom or after some time / after some actions?

@laktak

This comment has been minimized.

Copy link

laktak commented Sep 2, 2014

If I run atom --safe I get a constant cpu usage of 1-2% in the background (for Atom Helper with an untitle/empty window on 0.124/MacBook Pro).

I'd consider this way too high because it really should be using 0.

ps: also strange, if I open Prefs the cpu usage doubles.

@LukeMauldin

This comment has been minimized.

Copy link
Author

LukeMauldin commented Sep 2, 2014

Atom only takes up a small amount of CPU (1%) if I open a blank file. I receive the high CPU usage problem after having a PHP project (about 30 files) open and have doing development for 30 min to an hour.

@sylvanc

This comment has been minimized.

Copy link

sylvanc commented Nov 2, 2014

With Atom 0.141, on a late 2013 MacBook Air running OSX 10.10, running in safe mode produces an energy impact very close to 4.0 (about 6% CPU usage, all by Atom Helper) with the tree-view hidden and no files open, with a burst to around 30.0 every 4-5 seconds.

With the tree-view displayed it rises to 4.5, with a burst to 30.0 every 4-5 seconds.

With 12 C files open (average length 200 lines, longest length 1000 lines), it rises to 10.0 with a burst to 15.0 every 4-5 seconds. CPU usage runs a steady 8-10% with a burst to 15%.

Unfortunately, this means Atom is currently only usable if I'm plugged in to the wall, as it drains the battery (when idle, not editing text) at about the same rate as watching full screen video in VLC.

@wmertens

This comment has been minimized.

Copy link

wmertens commented Feb 17, 2015

I'm seeing this with 0.179.0 still. atom-helper "not responding" and 20-33% CPU in the Activity Monitor while Atom is idling.

Memory usage: 150MB real/4GB virtual

Here's a sampling of it: https://gist.github.com/wmertens/56aae47cab9eed0b1027

@fbender

This comment has been minimized.

Copy link

fbender commented Feb 18, 2015

I experience this issue as well and disabled all community packages (except lang-matlab-octave) and some core packages in v0.180.0 and still see an almost constant CPU usage of 5-8% with Atom in the background (window is not visible behind other app windows) and having 5 small to medium large HTML, CSS, and JS files open. Energy Factor is ~7 on my MBA 2012 with OS X 10.9.5. Having the window partially visible (but still in background) I can scroll a file which kicks the CPU up to 50-100% and Energy Factor to no less than 90.

Edit: Forgot to add – I restartet Atom multiple times to see if there's something astray running in the background. Did not see any change at all.

@zsgalusz

This comment has been minimized.

Copy link

zsgalusz commented Feb 21, 2015

I disabled every package including the default ones (save for settings-view) and AtomHelper was still gnawing 1-2% while idling in the background. Just switching to Atom and scrolling the settings spawns another AtomHelper using 30-50% CPU that stays until I switch away again. This is on a 2013 rMBP, Atom 0.182.0.

@mathie

This comment has been minimized.

Copy link

mathie commented Feb 26, 2015

Yeah, this matches what I'm seeing. The background CPU usage seems to be proportional to the number of open documents in a project. Right now, with 2 open documents, it's hovering at around 3%. With 18 open documents, it has settled down to ~20% background CPU usage. Activity monitor is showing the relative impact on the battery of keeping Atom open:

activity_monitor__applications_in_last_8_hours__and_atom_helper_high_cpu_usage_ issue__3426 atom_atom_and_my-favourite-interview-question_markdown-_users_mathie_development_personal_mathie_github_io-_atom

It's making Safari look good. ;-)

The helper seems to be the culprit:

atom_helper__61502_

Here's a random sample from while I was updating this issue: https://gist.github.com/mathie/7cca66994db9bcaefc1f

I'm on Mac OS X 10.10.3, Atom 0.182.0, on a 2013 Macbook Pro. All the files I had open at the time were Markdown text (if that's significant, plugin-wise). If there's any more information I can provide, please do ask.

@mathie

This comment has been minimized.

Copy link

mathie commented Feb 26, 2015

Running Atom in safe mode, the background CPU usage is less (~10% on average, I'd say). Here's a sample from safe mode: https://gist.github.com/mathie/d1742725372493b3af9a

A brief scan at the sample would suggest it's not terribly useful after all. All it says to me is, "V8 is running some JavaScript code." 😄 I wonder if NodeJS has dtrace hooks...?

@maxogden

This comment has been minimized.

Copy link

maxogden commented Mar 5, 2015

I am also experiencing this issue, it is causing a noticable reduction in the amount of time my laptop battery lasts

screen shot 2015-03-05 at 2 57 22 pm

@Antikythera

This comment has been minimized.

Copy link

Antikythera commented Mar 30, 2015

Hello guys, I just noticed this problem on 2015 MacbookAir. I was shocked to see that with 60% battery I had estimated 4-5 hours. So ofc I came to a same conclusion as you after seeing the results in activity monitor.
So if running Atom with --safe makes this problem go away, it means it's some package is causing it (correct me if i'm wrong). One thing came to mind, linters.
As soon as I disabled all linters, the power impact came back to normal.
Can someone confirm this too?
screen shot 2015-03-30 at 11 00 33 pm
The high average is from before.
screen shot 2015-03-30 at 11 01 03 pm

@Zireael07

This comment has been minimized.

Copy link

Zireael07 commented Mar 31, 2015

What are your linters set to? On save, on focus?

@zsgalusz

This comment has been minimized.

Copy link

zsgalusz commented Mar 31, 2015

I disabled everything, including linters.

@Antikythera

This comment has been minimized.

Copy link

Antikythera commented Mar 31, 2015

I wasn't even aware I could set that. Where do I look for those settings? It's not on the settings page.

@Zireael07

This comment has been minimized.

Copy link

Zireael07 commented Mar 31, 2015

@Antikythera: Click on the settings button under linter and you have lint on change, lint on editor focus, lint on save options.

@Antikythera

This comment has been minimized.

Copy link

Antikythera commented Mar 31, 2015

@Zireael07 Ok I had to manually change my config file. After reloading, those options showed up in the settings tab for linter. I will play around with these and post what I find out.

@Antikythera

This comment has been minimized.

Copy link

Antikythera commented Mar 31, 2015

So after a couple of hours of usage, and some linter config tweaks, this is the result.
screen shot 2015-03-31 at 7 00 03 pm
First thing I had to do is enable the settings for linterr. Config file had a linter section, but it was blank. So I added some options:

linter:
    LintOnSave: true
    LintOnChange: true
    lintOnChangeInterval: 5000

It is only after I did this that I could see all the settings for linter. The whole thing was just missing.
These are my current settings for linter.
screen shot 2015-03-31 at 7 06 58 pm
5 seconds for linting may be a bit sluggish but the impact on battery life is huge, I will try lowering this and see how low I can get it and still keep a sane power usage.

@Zireael07

This comment has been minimized.

Copy link

Zireael07 commented Mar 31, 2015

So, 314 impact is w/o linter and 718 w/ linter?

That points to linters possibly being to blame, not atom core.

@Antikythera

This comment has been minimized.

Copy link

Antikythera commented Apr 1, 2015

That average is taken from last 8 hours, so it's not really a good indicator since I didn't use atom equally when these screenshots were taken. But linters definitely have something to do with this issue, and the fact that increasing the delay between linting dramatically reduces energy impact just proves it.
I would really like if somebody could confirm this before we dismiss this problem tho.

@jtwebman

This comment has been minimized.

Copy link

jtwebman commented Apr 27, 2015

It seems to me that the linters should look at Reactive Ex libraries. I have never built an Atom plugin but instead of pulling ever second or 5 seconds they should just catch the OnTestChange event coming from the editor control. Maybe there isn't one and that is the issue. Something off it with a few 100 millisecond delay would fix this issue asap.

@davidawad

This comment has been minimized.

Copy link

davidawad commented Jun 24, 2015

+1, I've got 4 windows open on the highest spec'ed 2015 15 inch pro, and it's using 53% and 28% of my cpu in two separate processes.

@thomasjo

This comment has been minimized.

Copy link
Member

thomasjo commented Jun 24, 2015

@davidawad Can you reproduce what you're seeing when running Atom in safe mode? Completely shutdown all Atom instances and launch safe mode via atom --safe. I'm 99% sure your issue is caused by bad packages.

@mdalpi

This comment has been minimized.

Copy link

mdalpi commented Jun 25, 2015

I don't know if this helps but with a clean installation, safe booting and linters disabled I'm still getting high CPU usage when scrolling and it gets worse in larger Python files (>100%).

Here's a video (sorry for the host, don't use YouTube myself)
https://sendvid.com/887rxkjt

And here's the Javascript CPU Profile:
https://gist.github.com/mdalpi/a14f8e9da2e9a32f7b3b

OS X 10.10.3
(Old) Core 2 Duo

@f6v

This comment has been minimized.

Copy link

f6v commented Jun 27, 2015

Same here on Atom 1.0.0, OS X 10.10.13, MBP Retina 15 mid 2014

And running atom --safe has the same result, Atom Helper has high load on CPU.

@cage1016

This comment has been minimized.

Copy link

cage1016 commented Jun 28, 2015

Same problem on Atom 1.0.0, OS X 10.10.3, MBP Retina 15 mid 2015
Even run atom --safe got the same Atom Helper high CPU result.

@yibuyisheng

This comment has been minimized.

Copy link

yibuyisheng commented Jul 7, 2015

@cage1016 +1, and I installed the atom via script/build .

@methodbox

This comment has been minimized.

Copy link

methodbox commented Jan 6, 2016

Nice. I'll try a new install and see if #10249 resolves my issue.

@edocz

This comment has been minimized.

Copy link

edocz commented Jan 8, 2016

I just clean ~/.atom/packages and building nuclide from Source at /tmp and everything is fine!

@FyodorPavlovich

This comment has been minimized.

Copy link

FyodorPavlovich commented Jan 26, 2016

@joshaber I'm not sure that it has been. On Friday I obtained version 1.4.1, but still found Atom chewing through 1Gb+ of ram. I did find that deleting the .git folder from my home directory completely resolves the issue.

@50Wliu

This comment has been minimized.

Copy link
Member

50Wliu commented Jan 26, 2016

@FyodorPavlovich The fix is only in Atom 1.5.0 (currently in beta) and above. Sorry about the delay.

@FyodorPavlovich

This comment has been minimized.

Copy link

FyodorPavlovich commented Jan 26, 2016

@50Wliu Oh I see, thanks.

@timaschew

This comment has been minimized.

Copy link

timaschew commented Jan 27, 2016

1.5.0 beta1 is still freezing on OS X, but not so long

@timaschew

This comment has been minimized.

Copy link

timaschew commented Jan 29, 2016

update: now it also freezes until a message appear and I need to restart atom

@MatrixV01

This comment has been minimized.

Copy link

MatrixV01 commented Jan 29, 2016

I noticed that only when I tried to create/edit a new local file/folder that the Atom helper would destroy cpu usage. When I linked the same file/folder to a Github repo, it went back to normal. Not sure why helper goes crazy when you're in a file not associated with a repo.

@kexoth

This comment has been minimized.

Copy link

kexoth commented Mar 31, 2016

@MatrixV01 do you have any git-related plugins?
I had the same issue, I since I installed git-diff, merge-conflicts, tree-view-git-status etc.
After I read your comment I disabled them to see if some of them cause this issue.

@gregtatum

This comment has been minimized.

Copy link

gregtatum commented May 13, 2016

I have some specific steps to reproduce on my Macbook running OS X El Capitan, 10.11.4 involving an excessively large repo.

  • git clone git@github.com:mozilla/gecko-dev.git
  • atom --safe gecko-dev

CPU usage goes crazy in AtomHelper, 99%. Sometimes when closing out of atom the processes stick around as well.

  • mv gecko-dev/.git gecko-dev/git

CPU usage is down to sane levels in AtomHelper.

@methodbox

This comment has been minimized.

Copy link

methodbox commented May 13, 2016

@TatumCreative
Interesting, as this issue was in the beta for a while; if there was even a .git in your home directory it would cause this behavior.

However, that bug was closed a long time ago, the. A similar issue opened, and Atom devs said it was resolved.

When you cloned this repo, what path did it land in?

@jbskis

This comment has been minimized.

Copy link

jbskis commented May 14, 2016

I systematically disabled the recent packages I'd installed, and when I disabled the 'pigments' package my cpu demand for 'Atom Helper' dropped from 100 percent to 1 percent immediately!! No issues since.

@djwgen

This comment has been minimized.

Copy link

djwgen commented May 16, 2016

Based on @jbskis' post, I also disabled 'pigments' and saw the CPU usage of Atom Helper drop back to sane levels.

@gregtatum

This comment has been minimized.

Copy link

gregtatum commented May 19, 2016

@methodbox It does that at ~/desktop, and I have no .git folders in my home directory.

I have 2 solutions so far that lower my CPU usage.

Solution 1

I symlink the subfolder I'm working in to ~/my-subfolder and then work there. That way atom doesn't know about version control and CPU usage is minimal.

Solution 2

Use this forked branch that comments out one of the more intensive repo checking lines.

Run script/build --verbose --install-dir ~/Applications/AtomDebug.app" to build a custom build.

@electricarts

This comment has been minimized.

Copy link

electricarts commented May 25, 2016

The solution here is disabling the "Pigments" package. After disabling it the cpu usage goes back to 3%. After enabling the package the usage is 103%. Repeated it several times. Same result.

i7 iMac, 10.11.5

@gugote

This comment has been minimized.

Copy link

gugote commented May 25, 2016

Solution for me was disabling the Pigments package too. Sadly, because I love that package, but I can confirm that it was the cause of the trouble.

@BenGitsCode

This comment has been minimized.

Copy link

BenGitsCode commented May 26, 2016

Pigments package for me as well. I know I'm just echoing previous sentiments here but it really is a damn shame. I only encountered this issue today but Atom was using 102% of my cpu and so sluggish it was entirely unusable.

Anyone else still having issues with pigments disabled / without pigments in the first place?

Atom was running so slow I couldn't even load pigments' in settings, needed to disable from the command line. Smooth as butter anywhere from 1-5% usage since.

@qolop

This comment has been minimized.

Copy link

qolop commented May 28, 2016

+1. The Pigments package was the root of the issue for me on Ubuntu 16.04.

@sercanov

This comment has been minimized.

Copy link

sercanov commented Jul 17, 2016

I had no pigments package but disablinglinter-flow solves it too. eslint seems enough for now ^^

@methodbox

This comment has been minimized.

Copy link

methodbox commented Jul 21, 2016

@lee-dohm I'm really curious about a post you made on #1827 (closed) and exactly who you mean is the actual target audience for Atom. It seems like you're suggesting this is an editor that isn't made for "the masses" to use on their "standard" machines:

There are an infinite number of individual reasons why Atom might be consuming too much CPU. The general categories are:

Atom isn't designed to be a tiny native-code editor. If the ultimate in speed is what you're after, Atom probably isn't what you're looking for at least for now ... and possibly not ever depending on what you're expecting.

What exactly should we be expecting? As we troubleshoot "high" CPU usage, what does Atom's core developers consider low/med/high?

It seems like this issue is blown off each time a thread is created as user error. Just trying to get a better idea of who the target audience for Atom really is.

It would seem using Atom to edit an HTML, JS and CSS file at the same time would be an acceptable, standard use. If this isn't the intended usage for this app, please state so clearly.

@mnquintana mnquintana referenced this issue Aug 3, 2016

Closed

Atom Helper CPU Usage High #12241

4 of 6 tasks complete
@past

This comment has been minimized.

Copy link

past commented Sep 2, 2016

I do see this in 1.10 on latest OS X even with all non-core packages disabled. I don't think I saw that in 1.9 (at least not constantly), but I might be wrong.

@JohnMica

This comment has been minimized.

Copy link

JohnMica commented Sep 12, 2016

Seems this issue is old but it is still present today. On macSierra GM the helper runs cpu @ 50-120% while atom itself is mostly unresponsive... :( have to keep waiting for a new release as I haven't touched the conf besides fontfamily Monaco ....

@lee-dohm

This comment has been minimized.

Copy link
Member

lee-dohm commented Sep 13, 2016

There are an infinite number of individual reasons why Atom might be consuming too much CPU. The general categories are:

  1. Atom isn't designed to be a tiny native-code editor. If the ultimate in speed is what you're after, Atom probably isn't what you're looking for at least for now ... and possibly not ever depending on what you're expecting.
  2. An Atom package is causing a problem
  3. Atom itself is causing a problem

If Item 1 is the root of the problem, there are many other text editors that will probably suit your needs. Sublime Text is a popular one. vim is another. They were both designed with very different goals than Atom and if they suit your needs better, we're happy if you're happy 😀

If item 2 or 3 is more what is happening for you, then I invite you to take a look at the improved Atom Flight Manual. There is a tutorial on diagnosing runtime performance issues that will help you give us the information we need to track down these CPU problems.

So here's what I want people to do for us so that we can get these problems identified, root caused, and fixed:

  1. Determine to the best of your ability what actions or situations cause the problem
    • Does the problem only occur in certain projects or in all projects?
    • Does the problem occur right away or only after a long period of time?
    • Does the problem only happen when you do something specific like "only when I use Find in Project and include a file mask"? Or is it more of a general thing like "any time I use find-and-replace"?
  2. See if you can reproduce the problem in Safe Mode. Whether or not you can reproduce the problem in Safe Mode, we want to help with the problem ... but we need to know where to start looking. Remember, the longest git bisect session starts with a single division of the problem space 😀
  3. Use the runtime performance diagnosis tutorial to gather a CPU profile

Then, once you've done the above:

  • If you can reproduce the problem reliably, open a new Issue
    1. Fill out the template
    2. Include what version of Atom you're running by including the output of atom --version
    3. Include what OS and version you're running Atom on
    4. Include as much information as you can about what actions or situations cause the problem
    5. Include a mention of #3426 in the new Issue so that we know you're following these instructions
    6. Include the CPU profile that you recorded in the new Issue
  • If you need help reproducing the problem, go to Discuss, the official Atom message board and ask for help. There are plenty of people there (including myself and Atom volunteers) that will do their best to help you figure out what is going wrong so you can file an Issue to help us get it fixed!

We want to get all of these bugs nailed down, but like I said in my recent blog post, Issues need to be actionable. There needs to be a plan of action. This Issue doesn't have that, so I'm going to close it and ask people to work with me to help us tease out all the individual bugs from this mess.

Thanks for reading and I'm looking forward to seeing all the new Issues!

@lee-dohm lee-dohm closed this Sep 13, 2016

@atom atom locked and limited conversation to collaborators Sep 13, 2016

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