ARM memory footprint

1,705 views
Skip to first unread message

John Passaniti

unread,
Sep 23, 2011, 1:27:42 PM9/23/11
to nodejs
I'm evaluating Node.js for use in an embedded system. That system
would be running embedded Linux on an ARM9-class processor (yes, that
has a MMU, so it's not the MMU-less uClinux). The system would have
roughly 64 megabytes of RAM.

What I'm hoping someone here can give me is an indication of the
quiescent memory footprint of just Node.js targeting that platform.
That would be the size of the standard binary with any debugging
information stripped, and how much RAM Node and V8 gobble before any
application code is loaded. In other words, I want to get the base
memory "cost" of Node.js on such a platform.

The application that I am looking at using Node.js for would typically
involve UDP-based communications with a handful of embedded systems
while simultaneously managing a web-based GUI. So in this
application, we're not talking about a large number of concurrent
connections. Obviously the only way to know for sure what the run-
time cost of the application code and supporting in-memory data
structures will be is to code it and measure it. But before I run
down a road that may lead to nowhere, I am hoping that someone can
find some useful way to express how much memory I can expect to be
chewed up while Node.js is running code. I'm just looking for some
kind of gross measure that will tell me if Node.js (and V8) even makes
sense. Knowing that, I can either dive deeper or run away screaming.

Any information those who have worked with bringing Node.js to
embedded Linux on ARM is much appreciated.

Ben Noordhuis

unread,
Sep 23, 2011, 6:50:01 PM9/23/11
to nod...@googlegroups.com

It should be possible to run with only 64 MB but you will have to
tweak Node and/or your kernel. The issue I ran into (recently
actually) is that V8 tries to map a lot of virtual memory (like
hundreds of MBs) and will fail hard if your kernel doesn't like to
overcommit.

Dominic Tarr

unread,
Sep 23, 2011, 7:37:37 PM9/23/11
to nod...@googlegroups.com
on 32 bit, node running the REPL uses 10 meg, but allocates like 700?

it this correct?


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Curtis Schofield

unread,
Sep 24, 2011, 1:27:29 AM9/24/11
to nod...@googlegroups.com

rad project

AJ ONeal

unread,
Sep 26, 2011, 11:47:53 AM9/26/11
to nod...@googlegroups.com
On ARM

REPL is ~7.5MiB resident and ~45MiB virtual

With a light load of 5 http clients making back-to-back requests it uses 12MiB resident, 50MiB virtual.


Problems with ARM:

V8 VM is SLOW to load. 
Both reading files from NAND and compiling them to assembly before use can take seconds. Not good for an instant-on device.


Also, my loadimpact.com results are pretty dismal, but I haven't profiled to see where the tight spots are.

AJ ONeal

Ben Combee

unread,
Sep 26, 2011, 12:15:41 PM9/26/11
to nod...@googlegroups.com
> Problems with ARM:
> V8 VM is SLOW to load.
> Both reading files from NAND and compiling them to assembly before use can
> take seconds. Not good for an instant-on device.

Yeah, on webOS, we use a fork-server version of node.js for starting
new services without the overhead of getting a new V8 instance running
to reduce startup time.

Liam

unread,
Sep 26, 2011, 8:21:39 PM9/26/11
to nodejs
A "fork-server" version? Can you elaborate?

Also, NAND is slow -- isn't NAND typically faster than disk seek/read?

Ben Combee

unread,
Sep 26, 2011, 11:23:57 PM9/26/11
to nod...@googlegroups.com
>> Yeah, on webOS, we use a fork-server version of node.js for starting
>> new services without the overhead of getting a new V8 instance running
>> to reduce startup time.
>
> A "fork-server" version? Can you elaborate?

Basically, there's a node.js process running waiting for a connection
with parameters to start a service. When that comes in, we have an
extension that lets it call the system call fork() to start a new
process that has a copy-on-write duplication of the V8 context. I
don't think we've released our patches.

> Also, NAND is slow -- isn't NAND typically faster than disk seek/read?

It's faster to seek, but NAND memory often is directly off the CPU
memory bus which means the processor is completely occupied when
reading blocks of Flash into RAM. A system like the TouchPad actually
uses eMMC memory that looks like a block filesystem and benefits from
the ability to do DMA through a controller to copy from flash into
memory without blocking the CPU.

Liam

unread,
Sep 27, 2011, 7:43:09 AM9/27/11
to nodejs
On Sep 26, 8:23 pm, Ben Combee <ben.com...@gmail.com> wrote:
> >> Yeah, on webOS, we use a fork-server version of node.js for starting
> >> new services without the overhead of getting a new V8 instance running
> >> to reduce startup time.
>
> > A "fork-server" version? Can you elaborate?
>
> Basically, there's a node.js process running waiting for a connection
> with parameters to start a service.  When that comes in, we have an
> extension that lets it call the system call fork() to start a new
> process that has a copy-on-write duplication of the V8 context.  I
> don't think we've released our patches.

That patch sounds like it might be generally useful for an elastic
configuration of Node...?

> > Also, NAND is slow -- isn't NAND typically faster than disk seek/read?
>
> It's faster to seek, but NAND memory often is directly off the CPU
> memory bus which means the processor is completely occupied when
> reading blocks of Flash into RAM.  A system like the TouchPad actually
> uses eMMC memory that looks like a block filesystem and benefits from
> the ability to do DMA through a controller to copy from flash into
> memory without blocking the CPU.

Isn't most NAND these days on an SDIO (etc) bus, as with eMMC? (And
isn't "raw" NAND usually managed by a dedicated controller?)

Ben Combee

unread,
Sep 27, 2011, 10:02:39 AM9/27/11
to nod...@googlegroups.com
> Isn't most NAND these days on an SDIO (etc) bus, as with eMMC? (And
> isn't "raw" NAND usually managed by a dedicated controller?)

True -- my raw NAND experience was a few years ago on the Palm Foleo
which had a CPU-managed NAND chip running either YAFFS or JFFS
depending on the time of the project. That's where I personally saw
really slow NAND performance, I've not seen it as much with the
eMMC-based devices.

Alexander Shemshurenko

unread,
Oct 17, 2013, 4:28:30 AM10/17/13
to nod...@googlegroups.com
Hi.
I have very similar project. I have ARM9 embeded linux and i want to try node.js on it. Im kinda new in all this stuff. Can you point out some doucmentation to start with? Installation guides etc.

Michael Gärtner

unread,
Feb 18, 2014, 6:09:00 AM2/18/14
to nod...@googlegroups.com
Hi.I have a similar project. I have Cortex ARM9 embeded linux and i want to try node.js on it. I am new in all this stuff. Could someone point out some doucmentation to start with? Installation guides etc.
Reply all
Reply to author
Forward
0 new messages