So as some of you may know I love using the Atom text editor, I practically worship it while working with other developers. Today I had a bad experience for some reason (it was running in background - I wasn’t coding at the time - just chatting with friends) it tried to allocate 40GB of RAM then filled the disk with swap except for 4Gb of remaining disk space. I’m not sure exactly what happened however I killed it’s processes to avoid any further damage while I investigated.
I’m running macOS Sierra 10.12.6 on a Macbook Pro with a 120Gb SSD with 60Gb in use, 8Gb of RAM and a 2.7Ghz Processor. This should give you an idea of the performance impact that was going on.
What I found:
- I’m not sure whether this is related to Atom or not but a git repository somehow got created in my home directory, maybe I ran a script that uses Git (unlikely but possible, generally when I run scripts I’m in the Downloads or Documents folder), maybe I accidentally ran
git init and didn’t realize it (most likely scenario). Maybe something had created it however a large number on unstaged changes (basically everything from the last commit (if one even existed) which had been causing performance issues in Atom for some time. I didn’t even realize it until this evening.
- However this means Git has been tracking changes in application caches stored in my home directory.
- This was probably a ticking time-bomb (atom had said this huge number of files open at a time for a while - I ignored thinking it was being buggy or whatever) however finally atom responded to some git check (this may of been going on for weeks, I’m not sure how long) and ended up allocating this insane amount of memory in RAM (40Gb) + all free space - 5Gb (macOS likely blocked it from continuing to allocate or it would of allocated the entire disk).
- I removed the Git Repository and ran first aid on the system to recover the shock Atom Caused to file system. I’m working on measures that could warn me if a Git repo is made on the home directory root again.
What I learned:
Never, ever, ever run
git init in /home/username not even accidentally, there are tons of application caches and other stuff stored in hidden folders they’ll get tracked as unstaged changes, Atom’s behavior is if you are viewing a project folder that’s not a Git repo it’ll recursively go up until it finds one or none (assuming this ends at your home directory but it may be up to the disk root - maybe someone with Python experience here could audit Atom’s behavior on macOS) maybe I hit Atom’s internal limit of the amount of unstashed changes causing tonight’s mini disaster (again only someone with Python experience auditing Atom’s behavior on macOS could determine this). I determined that Atom’s Git Package may have some internal limits with huge amounts of unstaged files.
Will I still use Atom:
Absolutely, as far as my investigation went, I determined my error caused a Git Repository to be made on the home directory tracking cache changes, it caused Atom’s git package to hit an internal limit causing this. I obviously need some safe guards put in place to avoid making this mistake again and I’ll be auditing the software & scripts I run on a regularly basis for their use of Git to look for a relationship on whether they caused it or if it was 100% user error
What are your thoughts on this experience with Atom?