DEV Community


Posted on

How much ram does a basic nodejs 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 run:

import * as http from 'node:http';

const PORT = 8000;

http.createServer(async (req, res) => {
  writeHead(200, { 'Content-Type': 'text/html' })

console.log(`Server running at${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.


Top comments (0)