question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak when logging large amount of logs

See original GitHub issue

Please 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:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

4reactions
smashahcommented, Feb 2, 2022

@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

2reactions
TabestoJulienDuvignaucommented, Dec 1, 2020

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found