Atom tried to use 40Gb of RAM + all but 4Gb of disk as swap space


#1

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.

My System:
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?


#2

How it is possible to for Atom to allocate 40 GB of RAM when you only have 8 GB?
Can you please clarify it?


#3

Emphasis on the word tried, it wasn’t successful. However it was a valuable lesson on both system and application limits :slight_smile:


#4

Atom is mad. Use Sublime Text, bro.


#5

Personally I find Microsoft word to be better. I don’t even have to test my code to know it’s broken. The red lines tell me before I even compile!


#6

Atom is broken software, it uses Electron which essentially means it cannot compete with other editors in terms of speed and efficiency. Use NeoVim, SublimeText 3 or Notepad++

But in the end it is personal preference.

Here is a quick comparison between a huge amount of editors and a ton of data collected


#7

As an impartial, editor-agnostic observer, I must say that it sounds more like a Git/Mac/User problem than an Atom problem.


#8

PEBKAC – running git init in User home directory. :slight_smile: :slight_smile: :slight_smile:


#9

I prefer open source where possible.


#10

It wasn’t directly Atom’s fault, entirely user error. A non-browser-based fork bomb.


#11

It was entirely user error and caused Atom to become a fork bomb with uncommitted cache changes.


#12

That’s interesting. Word doesn’t support eslint :stuck_out_tongue:


#13

I prefer Atom - it eats tons of resources but I have a system with tons of resources to get around that :slight_smile:


#14

Respectable, I don’t have the resources to use Atom most of the time so I might be biased :wink:


#16

@woty Please private message your concerns to me.


#17

Working with Atom since a while and so far nothing as drastic had happened to me.

However I set up my terminal to always show the branch I’m on, this makes it easier to see if the folder I’m in is init with Git or not (and if so, which branch I’m working on).

This may be helpful to quickly realise something’s not quire right, for example if I saw:

user at MacBook-Pro in ~ on master*

I would instantly jump out of my chair in disbelief of my root being also a Git instance.
Maybe it will help.


personal side note: try Vim/NeoVim. It’s bloody hard and painful…
but after a while you ask yourself why are you still using the mouse and “break” the flow of your work


#18

ATOM is a bloatware! I recently move to VSCode from ST3.

I gotta say, it’s awesome!


#19

Use emacs, bro :stuck_out_tongue: (I’m a vim user myself actually haha)


#20

Visual Studio Code – getting better every month with updates brought by the open source community.


#21

I asked about things on Atom’s community (https://discuss.atom.io/t/atom-tried-to-use-40gb-of-ram-all-but-4gb-of-disk-as-swap-space/47560/2?u=nsuchy) and was told it’s not an uncommon experience.