facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 683 forks source link

100% CPU when opening a project or 'Settings > Packages' #84

Closed joecritch closed 8 years ago

joecritch commented 9 years ago

Hey, I've got no other packages activated inside of Atom, and after installing nuclide-installer package, I'm getting a 100% CPU. This is also happening when I try to view the Packages list inside of Atom, so I can't uninstall using the Prefs screen.

A brief issue, as I'm unfamiliar with the reporting process, but please let me know what information you require.

bolinfest commented 9 years ago

Are you on Windows, Mac, or Linux? Anything else about your system that might be special?

joecritch commented 9 years ago

.@bolinfest Mac, OS X Yosemite. My atom settings are symlinked, in the style of https://github.com/holman/dotfiles. Interestingly, the CPU still caps when I run atom with $ atom --safe. If you can point me to where I need to go, perhaps I can do some CPU profiling?

Sterbic commented 9 years ago

Same issue here on OS X 10.10.3 and Atom 0.211.0.

I installed nuclide through apm and now Atom Helper and npm max out their thread each time I start Atom. Loading the packages view in the settings tab take a few minutes.

After the first restart I had only 6 nuclide-* packages installed, after the second restart I see 9 packages so Atom Helper might be doing useful work. I still don't see some packages like nuclide-quick-open.

bolinfest commented 9 years ago

The nuclide-installer package goes through and runs apm install for each package in https://github.com/facebooknuclideapm/nuclide-installer/blob/master/lib/config.json. We're getting some reports that this is very, very slow. I'm also checking with GitHub to see if there's anything on their end that could be contributing to this.

bolinfest commented 9 years ago

You could experiment with installing each package through Atom's GUI to see if the behavior is any different. I need to dig into the code in settings-view to see if anything extra special happens there.

Sterbic commented 9 years ago

I am trying to uninstall everything through Atom's GUI but it's extremely slow and unresponsive. I will try a fresh install through the GUI and from source to check if there is any difference.

bolinfest commented 9 years ago

If you backup your ~/.atom/packages directory, that's the easiest way to remove all of your packages.

Sterbic commented 9 years ago

Even uninstalling a single package after disabling it takes several minutes and Atom Helper goes 100%. Shouldn't this be as fast as rm -r pkg_dir?

Building from source with ./scripts/dev/setup does solve the issue.

START INSTALL: 2015-06-24 01:17:17.482524
...
FINISH INSTALL: 2015-06-24 01:19:34.594759
PackageManager.install() took 137 seconds.

Now it takes less than 10 seconds to start Atom and load all packages, including 13 nuclide-* packages.

Sterbic commented 9 years ago

When installed from source, uninstalling through the GUI is almost instant as expected.

This is probably an issue with Atom and not directly nuclide: only the first uninstalled package is removed from the current search of installed packages, the other packages stay listed until I enter a different search term although they are not present in ~/.atom/packages any more.

Sterbic commented 9 years ago

I tried to install nuclide-installer through Atom's GUI and monitor the progress through ls ~/.atom/packages/. It took about 40 minutes to complete, but the 100% cpu issue is still there.

This is probably a wild guess, is there any chance Atom treats differently symlinked and normal packages?

mauriciord commented 9 years ago

Same problem for me. Installing with ./scripts/dev/setup is perfect now, but i want the apm install nuclide-installer. Did you tried sudo apm install nuclide-installer ?

Sterbic commented 9 years ago

I will give it a try, but I doubt it will make any difference. EDIT: no difference

grabbou commented 9 years ago

Just to add few more bits, I've tried installing both from Atom and from apm. Neither of them completed successfully as the Atom UI was just frozen. Afraid of the high CPU temperature for a few minutes, I've decided to build from source. The installation has finished w/o any problems, and all the components were there, but the whole UI was full of lags and the CPU usage was still as high as during the installation process. Decided to remove all the packages by using apm as the editor was completely unusable.

Atom 1.0, OS X Yosemite (10.10.3), Macbook Pro Early 2015

klvnptr commented 9 years ago

Same here. "Atom Helper" is running on 100% CPU on OS X 10.10.3.

zacharytamas commented 9 years ago

Same here. Atom is basically unusable right now. Major lag: I can finish a whole line of code before it actually appears on screen. I'm having to remove the packages one by one with apm just to restore it well enough to actually work today. OS X 10.10.3

kaizhang commented 9 years ago

Same here. OS X 10.10.3.

samueloph commented 9 years ago

I have a dirty workaround for this bug: It looks like removing atom and all its config. files resolves the problem [of course, making a new clean installation later].

rm -r .atom/ rm -r .config/Atom rm .atom rm -r /root/.atom/

You can check the proper atom's bug report here: https://github.com/atom/settings-view/issues/555.

mauriciord commented 9 years ago

I removed atom and its config several times, and i made a new clean installation later. Didn’t work for me.

Now i will try do the same with the new Atom 1.0.

EDIT: Same thing with the new Atom 1.0

chibipirate commented 9 years ago

Try apm uninstall * for any nuclide package you see. That seemed to do the trick for me. Keep in mind that I have yet to reinstall Nuclide.

samueloph commented 9 years ago

@chibipirate Could you confirm if reinstalling Nuclide didn't make atom crash again? I'm starting to think this problem is related to Nuclide, considering the number of people that are participating in the settings-view's bug report.

I reinstalled nuclide here and atom started to crash again.

rpedroni commented 9 years ago

Same here on OS X 10.10.3. I really do believe this is nuclide related since this has only happened after installation. For me, opening the settings panel starts the havoc

Edit: definitely nuclide related. Deleting all nuclide packages from ~/.atom/packages fixes the cpu use

cesarandreu commented 9 years ago

+1

After installing Nuclide, opening my settings shoots up CPU usage.

admmasters commented 9 years ago

Same. Only happening with Nuclide. Unusable for 5 or minutes after starting the app.

gothy commented 9 years ago

AtomHelper per opened window consumes 100% CPU even after closing the "Settings" tab. Waiting for more than 5minutes now... MacOS X Yosemite.

Removing all nuclide packages helps.

sglyon commented 9 years ago

Seeing this also -- posting so I'm notified of new comments

despairblue commented 9 years ago

@spencerlyon2 there is a subscribe button on the right :wink:

screen shot 2015-07-17 at 16 36 58

bneiluj commented 9 years ago

Any news on this issue ? "Atom Helper" is running on > 100% CPU on OS X 10.10.4 and Atom 1.0.15

bneiluj commented 9 years ago

I am sorry but for now the only answer is: rm -rf ~/.atom/packages/nuclide-*

despairblue commented 9 years ago

Have you tried the manual installation using scripts/dev/setup? That prevents this for me.

mauriciord commented 9 years ago

WOW ! Same here, i tried here on OS X El Captain, and my CPU 100% easy easy easy. I think i have a Mac Pro to solve this problem hahaha ! Impossible to use Nuclide here.

Em 21 de set de 2015, à(s) 08:24, Julien Bouteloup notifications@github.com escreveu:

rm -rf ~/.atom/packages/nuclide-*

derekvanvliet commented 9 years ago

I'm having the same problem after doing a fresh install of Atom and Nuclide on both OS X and Win7. Unfortunately this makes it pretty unusable for me.

samueloph commented 9 years ago

This has been happening at least since June 23, sincerely I don't think theres anybody working on this, I've dropped Nuclide long ago.

Can confirm this https://github.com/facebook/nuclide/issues/84#issuecomment-141945823 work though.

bneiluj commented 9 years ago

Weird because @ssorallen touched the repo 6 days ago. Why maintaining a project if nobody can use it?

despairblue commented 9 years ago

You can still use the manual installation method. That prevents this issue. I'd also liked to see this fixed, but it seems that noone even found out what the problem is: https://github.com/atom/settings-view/issues/551#issuecomment-114804300. When loading the packages it's reading a huge load of files, I'm not sure why.

derekvanvliet commented 9 years ago

@despairblue thanks for the work around. That worked.

So this is actually an issue in Atom? Not Nuclide?

despairblue commented 9 years ago

@derekvanvliet I'm not sure, I haven't found the time to debug this, but if you do, I'm sure a lot of people would be grateful :smiley:

DonSanto commented 9 years ago

I'm having this problem too. posting so I'm notified of new comments.

nguyenhuy commented 9 years ago

(@DonSanto You can subscribe to this thread using the "Subscribe" button on the right side. Sorry for spamming, everyone :) )

DonSanto commented 9 years ago

@nguyenhuy Thanks, I've been looking for that functionality but have not been able to find the button. Now I know where it is. :+1: (Sorry for spamming, just wanted to thank the guy :) )

cnjsstong commented 9 years ago

Same here.

OS X 10.10.5, Atom 1.0.15, installed nuclide from GUI.

pookah-net commented 9 years ago

Just had to restart my MBP; totally unresponsive, dialog indicates .context is missing, not sure why? (Permissions look okay.) Posting to get notifications!

/Ian

GameGamer43 commented 9 years ago

I have the same issue. It appear that if I remove all the nuclide packages from atom and then install from source, the issue is resolved and the load times for Atom greatly improve.

After further digging, load time improve if I disabled:

Disabling the above packages however does not resolve the issue with the high cpu load when going to the Packages screen from the Preference screen.

pookah-net commented 9 years ago

I ended up deleting nuclide in its entirety. I didn't want to spend an afternoon troubleshooting and after awhile, it just seemed that getting rid of nuclide was the easier option! Especially as most of the features from it that I was using were available in other packages.

bolinfest commented 9 years ago

I was doing some monitoring, and it seems like Atom sends individual requests to atom.io for every third-party package you have installed to see if you have the latest version of the package or not. Obviously when you have Nuclide installed, you have a lot of packages, so all of these requests (and presumably DOM updates as the requests come back) seem to be what upset Atom. Presumably things would be better if Atom had a batch API for this. /cc @thedaniel @nathansobo

adamdicarlo commented 9 years ago

@bolinfest That sounds pretty inefficient, but I'm leaning toward it* being mostly due to way too much JS code, as installing via nuclide-installer ends up adding > 2GB of packages :frowning: ... see https://github.com/facebook/nuclide/issues/203

* (edit) the problem of settings view hanging

thedaniel commented 9 years ago

@bolinfest You're right that there's a lot of opportunity to make settings-view more efficient, and we're down to add API endpoints to the package API as well to reduce the number of requests, etc. An issue on atom/settings-view would be a good place to start.

ku-kueihsi commented 9 years ago

The only workaround is manual installation, according to despairblue?

despairblue commented 9 years ago

@ku-kueihsi it seems so, though I haven't investigated any further, since, together with http://gh-release-watch.com/ (to remind me to update nuclide when a new release happens), the manual installation poses not that much of an additional effort. Simply cd in the repos directory and issue git pull && git checkout v0.0.x && scripts/dev/setup and that's it.

Though I'm still curious what the actual culprit is. I do have a lot of packages installed, but only when I install the nuclide-installer this issue appears, none of the other packages provoke this.

yubozhao commented 9 years ago

tried @despairblue 's manual installation...Atom failed to open now.... Going to drop Nuclide until this resolve.

Setup: Mac 10.11, Atom 1.0.19. Clean Atom environment without any community packages.

despairblue commented 9 years ago

The first start after the installation can take a couple of minutes, while atom does whatever it does. After that it starts fine.

On Mon, Oct 12, 2015, 01:32 Bozhao notifications@github.com wrote:

tried @despairblue https://github.com/despairblue 's manual installation...Atom failed to open now.... Going to drop Nuclide until this resolve.

Setup: Mac 10.11, Atom 1.0.19. Clean Atom environment without any community packages.

— Reply to this email directly or view it on GitHub https://github.com/facebook/nuclide/issues/84#issuecomment-147255370.


Q: Why is this email five sentences or less? A: http://five.sentenc.es