A simple, bare-bones package for monitoring NodeJS memory usage using the console.
npm install memory-lite- Installation
- Usage
- Arguments
- Contribute
- Support
```
$ yarn add memory-monitor
`javascript
//
import memoryMonitor from 'memory-lite';
memoryMonitor({
interval: 10000,
rss: true,
heapTotal: true,
heapUsed: false,
external: false,
arrayBuffers: false
});
`
With this default setup, the following will be output to the console at 10 second intervals (numbers shown are arbitrary):
``
rss: 21.9 MiB | heapTotal: 4.6 MiB
If all boolean arguments set to true, the following will be output to the console: ``
rss: 22.9 MiB | heapTotal: 4.9 MiB | heapUsed: 4.3 MiB | external: 294.7 KiB | arrayBuffers: 43.7 KiBintervalArguments
| Name | Default | Description |
| -------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| | 10000 (ms) | The sampling rate expressed as time between sample (and subsequent logging) events. |rss
| | true | Determines whether or not rss should be included in the output. |heapTotal
| | true | Determines whether or not heapTotal should be included in the output. |heapUsed
| | false | Determines whether or not heapUsed should be included in the output. |external
| | false | Determines whether or not external should be included in the output. |arrayBuffers
| | false` | Determines whether or not arrayBuffers should be included in the output. |
These would constitute fairly large changes and may even warrant packages of their own, however they are valid ideas for improving the utility of this package.