Memory leak when logging large amount of logs
See original GitHub issuePlease tell us about your environment:
-
winston
version?-
winston@2
-
winston@3
v3.3.3
-
-
node -v
outputs: v14.15.0 -
Operating System? macOs and Linux (Docker)
-
Language? ES6 CommonJS
What is the problem?
When logging a large amount of logs, the memory keeps increasing without never decreasing at any time.
You can see an example script here: https://gist.github.com/TabestoJulienDuvignau/ec565b6ec2d788022a068be7f875ea87 Or running it here: https://codesandbox.io/s/solitary-cache-4r7v6?file=/src/index.js
You can increase the number of loop (max
variable) performed to see the memory usage increasing.
What do you expect to happen instead?
The memory used should be stable and decrease at the end of the processing.
Other information
The script is very aggressive but it highlight correctly the issue we are facing in our production application since we have implemented Winston.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Memory leak when logging complex objects - Stack Overflow
log (severity. information, 'DB opened', db); Now the problem I have is that this results in a memory leak. The problem is that...
Read more >7 Problems to Look out for When Analyzing Garbage ...
7 Problems to Look out for When Analyzing Garbage Collection Logs · 1. GC pauses cause apps to stall · 2. Memory leaks...
Read more >Can console.log() cause memory leaks? How to make a ...
console.log() causes memory leaks but only when the console is opened. Normally users do not open the console. So it is totally safe...
Read more >Hunting Java Memory Leaks - Toptal
Performance: usually associated with excessive object creation and deletion, long delays in garbage collection, excessive operating system page swapping, and ...
Read more >Java Memory Leaks: Solutions, Tools, Tutorials & More - Stackify
Another area where memory leaks might be a problem is when the program calls for a lot of temporary objects that use up...
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
@DABH
I have made 2 PRs to resolve this issue. One here and one in winston-transport
https://github.com/winstonjs/winston/pull/2057
https://github.com/winstonjs/winston-transport/pull/81
thanks
I forgot to mention that even if the log level is lower than the log level currently setup, the problems occurs (as in my example script)