Description
Description
We have identified a memory leak in our application that is caused by the node-tar library.
The issue is related to the normalize-unicode.ts file specifically around line 5. Here is the link to the relevant code:
https://github.com/isaacs/node-tar/blob/main/src/normalize-unicode.ts#L5
There is a global cache causing the issue. My suggestion, if we really need a cache there, to improve performance and reduce memory usage, the cache should be implemented as a Least Recently Used (LRU) or be scoped to the current execution context.
Steps to Reproduce:
Integrate the node-tar library into your project.
Use the normalize-unicode function in a high-frequency loop with large data sets.
Monitor the memory usage of the application over time.
Expected Behavior: The memory usage should remain stable and not increase significantly over time.
Actual Behavior: The memory usage increases continuously, leading to a memory leak.
Environment:
node-tar version: latest
Node.js version: node 22
Operating System: linux
Activity