Skip to content
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

Massive memory usage (1.4GB) #178

Closed
bleachedsleet opened this issue Oct 24, 2015 · 24 comments
Closed

Massive memory usage (1.4GB) #178

bleachedsleet opened this issue Oct 24, 2015 · 24 comments

Comments

@bleachedsleet
Copy link

N1 if left open will eventually consume about 1.4 gigs of my RAM which is quite excessive. This is collective and includes the electronJS processes that are spawned.

@shawnzvinis
Copy link

+1 on "doesn't quit" and "manual sync".

@bengotow
Copy link
Contributor

Hey @scratchfive — have you updated to 0.3.19? There was a pretty bad memory leak in earlier versions which was fixed in ad52740.

If you run into that memory issue on 0.3.19, it'd be great if you could run a Heap Snapshot in the Chrome Developer Tools and post the output here. It provides some pretty amazing detail and we can see specifically what we need to fix.

To submit a heap snapshot, do the following in the app's main window, and also in the work window (which you can show via Cmd-Option-W):

Press Cmd-Opt-I to open the Developer Tools, then choose "Profiles" from the top menu. Click "Take Heap Snapshot" and then "Take Snapshot". In the sidebar it'll say "Snapshot 1". Choose "Save" and send it our way!

@bengotow
Copy link
Contributor

(The other parts of this ticket are duplicates of #173 and #167 and #145 so I'm going to edit it to just address the memory issue)

@bengotow bengotow changed the title Massive memory usage and a few other bugs Massive memory usage (1.4GB) Oct 24, 2015
@bleachedsleet
Copy link
Author

Currently running build 0.3.19-de7d1bb. I've attached a link to an archive containing the heap snapshots requested as they are rather large. https://www.dropbox.com/s/bgryu8uc2aexqbl/heapfiles.7z?dl=0

@PlugaruT
Copy link

I am running the latest version and here is what I have under Windows:
1

@jadchaar
Copy link

Can corroborate that this issue is not only present on Windows, but also on OS X 10.11 (probably earlier versions also). The "Electron Helper" process is sucking up huge amounts of memory when the app is kept open for a while. The N1 process only takes up about 50-100mb though, so that is not the issue.

This is the "Electron Helper" process usage after a complete restart of Nylas N1: screen shot. It is way too much memory usage for a dormant task.

When I see the memory leaks occur again, I will post a screenshot.

@bengotow
Copy link
Contributor

Hey folks,

Thanks for the heap trace @scratchfive — I should be able to diagnose the problem based on that. Unfortunately, 1.4+ GB is an issue, but 300-400MB of RAM is the expected memory usage. I agree that 400MB or RAM is /also/ a crazy huge amount, but N1 is built on Chromium and is equivalent to running Chrome with 5 tabs fairly large open. Chrome unfortunately uses about 50-100MB of RAM per tab:

image

Chromium has been working to reduce this, and Chromium 45 uses less memory. We haven't moved to it yet, but we plan on doing so as soon as it's stable.

@jadchaar
Copy link

Ah, the Chromium core is definitely the issue. 400mb is the usage at startup, but it was reaching a monumental amount after being open for a while (it was open for about 2 days, with a few computer sleeps in between). I'll post a screenshot when it occurs again.

Funny thing is that I just noticed that a NYT infographic/animation article on Hurricane Patricia was open in a background Chrome Window (minimized) and when I closed it, my memory usage went from about 5.2Gb to 2.8Gb! Insane memory leak on Chrome's end; good I just reported it to them.

@bengotow
Copy link
Contributor

Yeah—we have plans to cut memory usage within the app by being smarter about how we hold your contacts in memory, fixing leaks found in heap files, etc... Fixing leaks is totally doable and the app should never use 1.4GB of RAM. At the end of the day though, I think we'll get memory usage down to about ~350MB all the time, but it's unlikely it'll go any lower because it's Chromium under the hood.

@jadchaar
Copy link

Totally understandable! Hopefully Chromium will continue to improve its memory usage also.

@caloon
Copy link

caloon commented Nov 16, 2015

I also came along this issue. Just to let you know: On my Macbook 12" the Electron Helpers are taking up a total of 643MB and additionally the Nylas N1 process about 76MB. Sums up to a total of 719MB. Still a lot of memory usage, especially when you consider the lower hardware specs of my model.

By the way, I have four email accounts connected - how big is the effect on memory usage when adding additional accounts, do you know that? I might delete some otherwise.

@patrickheeney
Copy link

As another data point, I have 2 accounts setup. Electron helper uses just over 1GB. Nylas is using 61MB.

@mbilker
Copy link
Contributor

mbilker commented Dec 2, 2015

Is still an issue?

@patrickheeney
Copy link

@mbilker I am seeing about 450MB with Electron Helper and Nylas with 2 accounts setup. Definitely seems to be an improvement for me and close to the goal of "~350MB all of the time".

@mbilker
Copy link
Contributor

mbilker commented Dec 3, 2015

@patrickheeney well that is better. Under my Linux setup I see around that, but I am not always sure because of shared memory, GPU memory maps, mmap-ed files, and copy-on-write memory.

@caloon
Copy link

caloon commented Dec 3, 2015

It's also down for me. Around 500MB. Thanks.

@cfblaeb
Copy link

cfblaeb commented Feb 15, 2016

On Ubuntu 15.10 there are 7 threads open with a combined memory usage of almost 1 GB.
N1 version 0.4.5-b0ec355

@mbilker
Copy link
Contributor

mbilker commented Feb 15, 2016

That is normal since N1 uses Chromium's process model.
On Mon, Feb 15, 2016 at 7:44 AM cfblaeb notifications@github.com wrote:

On Ubuntu 15.10 there are 7 threads open with a combined memory usage of
almost 1 GB.
N1 version 0.4.5-b0ec355


Reply to this email directly or view it on GitHub
#178 (comment).

@cfblaeb
Copy link

cfblaeb commented Feb 15, 2016

While it may be normal, is it really desirable that an email client requires a gb of memory?

@mbilker
Copy link
Contributor

mbilker commented Feb 16, 2016

It is being worked on, but the focus currently on features and bug fixing.

@mbilker mbilker closed this as completed Feb 18, 2016
@bertrand47
Copy link

Hi,
For me under linux: 365M with 3 acounts and version 0.4.14. It's better :)

captureecrandeepin20160312140539

@mbilker
Copy link
Contributor

mbilker commented Mar 12, 2016

That's good @bertrand47. I notice the same under htop where I get similar readouts by subtracting shared memory from reserved memory. The virtual memory size is very large at around 5 GB, but virtual memory is always out of proportions with the actual memory used.

@space-potato
Copy link

It's also like that on windows now (it should use even less RAM than your screenshot).
To the devs: is there a way you could improve the ram usage even more? Why is it even based on a browser (chromium)?

@edheltzel
Copy link

I know this was closed but the latest build is still using, 1GB+ of RAM on my MBPr anything else I need to provide?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests