DEV Community

GreggHume
GreggHume

Posted on • Edited on

Nodejs: How much ram does a basic node app use?

The answer is: 32mbs of ram.

I got this by setting up a basic node server (i am running node v16.14.0) and used PM2 to monitor its usage:
Screen shot of nodejs memory consumption

Code ran:



import * as http from 'node:http';

const PORT = 8000;

http.createServer(async (req, res) => {
  res.
  writeHead(200, { 'Content-Type': 'text/html' })
  .end("hello");
}).listen(PORT);

console.log(`Server running at http://127.0.0.1:${PORT}/`);


Enter fullscreen mode Exit fullscreen mode

This test was done to know the baseline of a nodejs runtime so you can understand your codes memory impact and work to improve from there.

Thanks,
Gregg

Top comments (0)