Skip to content

Hello world take so many memory #222

Description

@batobolg
  • Version:v4.4.7
  • Platform: Linux ainode06 3.10.0-327.10.1.el7.x86_64 Update README for help #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: CentOS 7

[bato@ainode06 nodejs]$ ./node-v4.4.7-linux-x64/bin/node -v
v4.4.7


my server.js is


[bato@ainode06 node-v4.4.7-linux-x64]$ cat server.js

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello World\n');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

and after use ab command bench
the nodejs memory like this


[bato@ainode06 ~]$ ps u

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
bato      6150  0.0  0.0 151024  1780 pts/2    R+   15:06   0:00 ps u
bato     17496  0.0  0.0 115472  2248 pts/1    Ss   13:48   0:00 -bash
bato     19341 12.2  0.1 913832 60144 pts/1    Sl+  13:54   8:45 bin/node server.js

i don't know why node js take 60144kb memory just for hello world program. any information ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions