Skip to content

Memory leak in PCMetrics class #859

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

Open
CMExile opened this issue Apr 3, 2025 · 0 comments
Open

Memory leak in PCMetrics class #859

CMExile opened this issue Apr 3, 2025 · 0 comments

Comments

@CMExile
Copy link

CMExile commented Apr 3, 2025

My team is using parallel-consumer in production, and we observed increasing memory usage over time in all of our services.
After monitoring the heap, we found that this stack trace was responsible for 96% of the heap size after 3 days of uptime:

Image

Image

This is reproducible locally. Whenever the parallel-consumer attempts to commit its offsets, it creates two new timers and adds them to the registeredMetrics list in PCMetrics, even if the exact tag combination already exists.

Keeping track of the registeredMetrics list shows this after 10 minutes (With a 1 second commit interval):
Image

Changing the list to a set seems to fix the issue, but not sure if a more sophisticated method would be preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant