puzpuzpuz / cls-rtracer

Request Tracer - CLS-based request id generation for Express, Fastify, Koa and Hapi, batteries included
MIT License
311 stars 24 forks source link

Memory leak in 2.6.1 #61

Closed Tirke closed 2 years ago

Tirke commented 2 years ago

Hello,

We did a release two days ago that bumped many packages including a cls-rtracer bump from 2.6.0 to 2.6.1. We quickly started experiencing memory leaks on all our services as shown below (sample).

image

We did rollback the release and then released again yesterday. By dumping the memory I did come to the conclusion that cls-rtracer@2.6.1 was leaking. After rollbacking to 2.6.0 and deploying everything again, leaks have disappeared.

Can't share full heapdump but I did saw a pattern of increasing memory usage of cls-rtracer objects.

image

Then 7 minutes later

image

Also

image

Then 7 minutes later

image
puzpuzpuz commented 2 years ago

@Tirke thanks for the bug report. I found the issue and hopefully fixed it in 2.6.2. Could you try that version and share the results?

holzerch commented 2 years ago

I can confirm that our memory leak was fixed with the latest version. Thank you!