nw.exe memory efficiency

7 views
Skip to first unread message

Gregg Ramsey

unread,
Apr 9, 2014, 2:35:54 AM4/9/14
to node-...@googlegroups.com

We are building a node-webkit app and need it to be as light on memory as possible. 


On analysing how it loads, I see that when nw.exe starts, it loads a second copy of nw.exe as a child process. 


As I open more windows, it ends up loading several more child process copies of nw.exe, each taking up a decent amount of RAM. Our small app becomes 100-200 MB+ in a short time.


I notice that it doesn't do this for every window I open.


I know that Chrome/web-kit is quite memory hungry but want to reduce my memory footprint as much as possible. To this end, I have a few questions?


1. Under what circumstances will it spawn a new nw.exe child process? 


2. Why does it work this way in the first place?


3. Is there any way to avoid this and run everything in a single nw.exe process?


4. What other tips are there, to help reduce my application's memory usage?


Thanks.

Anatoly Pashin

unread,
Apr 9, 2014, 2:37:36 AM4/9/14
to node-...@googlegroups.com
Main process + gpu process + new process for each new window (renderer). You can't run it singleprocess.


--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Пашин Анатолий,
эникейщик.

Gregg Ramsey

unread,
Apr 9, 2014, 4:06:41 PM4/9/14
to node-...@googlegroups.com
Thanks Anatoly, you mention a new process for each window. I notice that after I get to 4 nw.exe's, I can add as many windows as I like but no more nw.exe's are spawned. Perhaps at one point, it starts using the same nw.exe for a collection of Windows.

Therefore I'm still confused as to how it decides when to fire of a new nw.exe. Any other thoughts?

Anatoly Pashin

unread,
Apr 9, 2014, 5:42:01 PM4/9/14
to node-...@googlegroups.com
It can be memory sharing like Chrome or Chromium has — if you middle click on link to open it in background tab, that tab is rendered with same process. I'm not truth source, so you'd prefer to read chromium sources or ask chromium dev maillist.


2014-04-10 7:06 GMT+11:00 Gregg Ramsey <gregg....@gmail.com>:
Thanks Anatoly, you mention a new process for each window. I notice that after I get to 4 nw.exe's, I can add as many windows as I like but no more nw.exe's are spawned. Perhaps at one point, it starts using the same nw.exe for a collection of Windows.

Therefore I'm still confused as to how it decides when to fire of a new nw.exe. Any other thoughts?

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Пашин Анатолий,
эникейщик.
Reply all
Reply to author
Forward
0 new messages