Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to measure peak memory usage for current node.js process

Tags:

node.js

Is there a way to find the peak memory usage for current node.js process? Best would be platform independent, but else something in Linux only? No extra tools allowed like for example valgrind or whatever.

like image 871
Alfred Avatar asked Sep 06 '25 18:09

Alfred


1 Answers

You could take snapshots using the process.memoryUsage() method, and cache them.

Node.js Docs for process module

like image 177
ruffrey Avatar answered Sep 09 '25 21:09

ruffrey