1.0.6 • Published 5 years ago
@luvsharma1931/memory-profiler v1.0.6
memory-profiler: Intelligent memory profiler for Node.js applications to provide memory leak and heap memory usage information
npm install @luvsharma1931/memory-profiler
- It is a
plug and play modulecreated using Node.js which can be easily imported with a single import statement in your node.js application. - This module provides
fully automated memory profilingprocess for Node.js applications and does not require any manual intervention at all from developers. - It also automatically
creates report files for memory leak information and heap memory usageby the application which are saved at a default system location and can also be shared with teams.

- These files contain data in
JSON formatand can directly be used as a data source for visualization tools likeKibana or Graphanato show graphs and charts depicting the heap memory usage trends or memory leak trends for your Node.js applications. - This module can run memory profiling for your application for
‘n’ number of dayscontinuously without requiring any manual effort from developer. - Also, it can be used to
run memory profiling on production/release candidate builds(live deployments)created using CI/CD pipelines as it is easily imported with a single import statement and no complex integration is required at all.
Installation
Please make sure you have Python version 2.7.18(recommended) or greater installed on your system. You can install it from official python website:
https://www.python.org/downloads/release/python-2718/
- Install the memory-profiler using npm:
npm install @luvsharma1931/memory-profiler- The module has to be imported in the Node.js application code using a single line import statement.
var memoryProfiler = require("@luvsharma1931/memory-profiler");How does this plug n play module works?
- When the Node.js application gets started and comes to running state, the memory profiling also automatically starts running for this application and the module creates three files –
memoryStats.txt, memoryLeak.txt, logs.txtat default system location –“C:\memory-profiler-logs\”. - The module writes
heap memory usagedata to the memoryStats.txt file at times just after a garbage collection is run automatically in the Node.js runtime environment. - If a
memory leakis found by the module, it writes the leak information to memoryLeak.txt file. If any error occurs during the memory profiling process, the module logs the error message to logs.txt file. - The module logs an info message in the logs.txt file indicating that memory profiling started successfully.


Please feel free to provide your feedback and contribute to this project by creating a pull request. You can also reach me via email - luvsharma1931@yahoo.com