Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Memory Leak caused by unique Winston categories

Open
#141 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, nodejs
Domain
backend

Research direction

Start with src/authentication/logging/Logger.js at line 26 and reproduce the category loop or repeated endpoint calls described in the issue. Trace how Winston loggers are created and retained, then verify that repeated calls no longer cause unbounded logger accumulation.

Written by the indexing model from the issue text.

Description

When calling winston.loggers.get("category1"), if a logger with the category of "category1" is not found, it will automatically be created.

This means if we run the following code we will create 1000 separate Winston loggers.

for (let i = 0; i < 1000; i++) {
  winston.loggers.get("category" + i);
}

Similarly, when any endpoint is called, the following code is run, resulting in a new Winston logger being created. https://github.com/CyberSource/cybersource-rest-client-node/blob/31baaba047b3efe62e418bd11680599a138644da/src/authentication/logging/Logger.js#L26

To my knowledge, this logger is never closed, and so new Winston loggers pile up on the heap.

Dominant language
JavaScript
Stars
50
Forks
50
Avg merge
19m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CyberSource/cybersource-rest-client-node

All issues in CyberSource/cybersource-rest-client-node

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.