-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: When using winston v3 on node14.18.3, there seems to be a memory leak event. #2114
Comments
Thanks for the detailed report! I had to make a few tweaks to get initial stats reported: const w = require('winston')
const printStats = () => {
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`);
}
setInterval(printStats, 1000);
printStats();
setInterval(() => {
w.error('test'.repeat(100));
}, 10) I did not notice much of an increase in memory usage, even when making that 100 into 10000, though the logging interval function only repeats 17x in either case (and I don't fully understand why). The snipped portion for me is: |
I think without config |
When there is no transport configured, in order to control the size, it should be good to truncate the buffer, making sure it always below a certain size. |
Is there any update on this? |
This memory leak is about use Winston V3 without any transports.. So make sure you add transports for V3 and I enhanced the doc and warning message in Winston for this issue.
|
@zizifn We are getting the issue with transport configured as below
|
I solved this warn message by removing an invocation of .clear() before start logging... |
We are facing the same issue, Winston logger is causing memory leaks, transport is already configured in our case as well. Do we have any update on the fix of this issue ? we are facing issues on Prod and some update on this will help - as it's urgent. |
@Shahtaj-Khalid what version of Node are you using? |
@wbt I'm using node v13.8.0 and latest version of winston logger. Also, it is high priority issue for us as it is effecting our prod environment. If it doesn't get fixed, we'll unfortunately have to consider other loggers. Thanks. |
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. |
🔎 Search Terms
memory leak
The problem
I found memory leaks when using winston v3.7.2.
node test-winston.js 2> /dev/null
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
Additional information
In v2.4.5, the increase in memory usage has not occurred as in this case.
The text was updated successfully, but these errors were encountered: