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

Compiling NodeJS memory leak #119

Open
miha-plesko opened this issue Oct 28, 2016 · 2 comments
Open

Compiling NodeJS memory leak #119

miha-plesko opened this issue Oct 28, 2016 · 2 comments

Comments

@miha-plesko
Copy link

So I'm trying to run this NodeJS application with Rumprun.
I've git-cloned it to the rumprun-packages/nodejs/examples and run following commands:

zip -r ./word-finder.zip word-finder
./zipload.sh /word-finder/start.js < ./word-finder.zip > aplikacija_word-finder.js
ln -sf examples/aplikacija_word-finder.js ../rumpmain.js
make -C ..   # <---------------- CONSUMES ALL THE MEMORY (14GB)

as suggested in NodeJS readme. BUT the make command fails after some time saying:

virtual memory exhausted: Cannot allocate memory
node.target.mk:151: recipe for target '/.../rumprun-packages/nodejs/build-4.3.0/out/Release/obj.target/node/src/node_javascript.o' failed
make[2]: *** [/.../rumprun-packages/nodejs/build-4.3.0/out/Release/obj.target/node/src/node_javascript.o] Error 1
make[2]: Leaving directory '/.../rumprun-packages/nodejs/build-4.3.0/out'
Makefile:45: recipe for target 'node' failed
make[1]: *** [node] Error 2
make[1]: Leaving directory '/.../rumprun-packages/nodejs/build-4.3.0'
Makefile:35: recipe for target 'build-4.3.0/out/Release/node' failed
make: *** [build-4.3.0/out/Release/node] Error 2
make: Leaving directory '/.../rumprun-packages/nodejs'

I run this on a machine with 10GB RAM plus 4GB swap. With htop I can see that all the memmory is consumed indeed. Now, the NodeJS application is around 100MB big. Why would make consume 14GB of memory? 😄

@miha-plesko
Copy link
Author

I went crazy and used 14GB of memory + 4GB swap. This time it compiled successfully, but only barely.
So it takes slightly less than 18GB of memory to compile unikernel - is this expected?

The result in rumprun-packages/nodejs/build-4.3.0/out/Release/node-aplikacija_word-finder is 108MB big.
I hardly imagine what was make doing to consume 18 gigs.

Any idea?

@anttikantee
Copy link
Member

We don't supply the toolchain, so it's tough to say why it's using so much memory. Maybe you can play around with different version of cc/make/ld (whichever was consuming the memory). My poor development laptop has nowhere near 18GB of memory, so I'm sure it didn't consume that much when I tried node.js out.

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

2 participants