[Bug]: When using winston v3 on node14.18.3, there seems to be a memory leak event.
See original GitHub issueš Search Terms
memory leak
The problem
I found memory leaks when using winston v3.7.2.
node test-winston.js 2> /dev/null
RSS: 28.9921875 MB
heap used/total: 4.790740966796875/8.57421875 MB
...
... snip ...
...
RSS: 195.984375 MB
heap used/total: 49.476966857910156/50.82421875 MB
What version of Winston presents the issue?
3.7.2
What version of Node are you using?
v14.18.3
If this worked in a previous version of Winston, which was it?
v2.4.5
Minimum Working Example
const w = require('winston')
setInterval(() => {
w.error('test'.repeat(100))
}, 10)
setInterval(() => {
const MB_DIV = 1024 * 1024;
const usage = process.memoryUsage();
console.log(`RSS: ${usage.rss / MB_DIV} MB`);
console.log(`heap used/total: ${usage.heapUsed / MB_DIV }/${usage.heapTotal / MB_DIV} MB`);
}, 1000);
Additional information
In v2.4.5, the increase in memory usage has not occurred as in this case.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Why are strings passed to winston kept in memory, leaking ...
This was a bug in Winston related to how it used streams. It was fixed in a pull request, you can read more...
Read more >Node.js Memory Leak Detection: How to Debug & Avoid Them
The use of setTimeout, setInterval, Observers, and event listeners can cause memory leaks when heavy object references are kept in theirĀ ...
Read more >Read more - GitHub
v8.11.1 (2022-05-13) * Fixed an issue with winston instrumentation that ... to resolve all promises in your application will result in memory leaks...
Read more >Node Cookbook - DOKUMEN.PUB
node greeting.js. 3. Exit the program using CTRL + C. 4. We can now tell the program what it should do each time...
Read more >newrelic/NEWS.md - UNPKG
It appears several objects created by grpc-js (`ChannelImplementation` and ... issue where capturing axios request errors could result in a memory leak.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@zizifn We are getting the issue with transport configured as below
That doesnāt provide āall the details along with how we can reproduce the issueā - it isnāt even logging one message, let alone enough to be overwhelming
That is not the threat you might think it is. If you need contracted reliability youāll have to pay a service provider for that.
You can probably pay less for an engineer to start from something that mostly works but has a few bugs (and contribute those working solutions back to the community, where the benefits can be all shared and better maintained) than to start from scratch. If you think another logging library is a better starting point, please feel free to use that. If youāre interested in providing some serious funding to the Winston project, please say so. It currently has none, and businesses relying on it have no right to insist that very-limited-time volunteers burn hours trying to fix issues that you and not we are encountering, especially when provided reports donāt make it easy to reliably reproduce the problem.