# Help with identifying memory leak

**URL:** <https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890>\
**Category:** mediasoup libraries\
**Created:** [October 19, 2020, 10:37am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890 "2020-10-19T10:37:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gurupras](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/gurupras/32/738_2.png) [@gurupras](https://mediasoup.discourse.group/u/gurupras)\
**Post date:** [October 19, 2020, 10:37am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890/1 "2020-10-19T10:37:16Z")

</div>

I realize that this is most likely an issue with my code, but I’m posting it here in the off-chance that this is related to the library. So feel free to close/delete the issue if it is.

After shutting down all clients, I did a heapdump of my nodeJS process and noticed that a bunch of consumers weren’t cleared out.

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/e27561977dace8c27c0d17d105e2171241fa4c7c.png)

When I check the `PipeTransport`s, I get the following:

 ![image](https://global.discourse-cdn.com/free1/uploads/mediasoup/original/1X/5bf084f7286adfd92194fff026e01f696d3f66a0.png)

I’m not very knowledgeable in reading heapdumps, but any chance this is a leak in the mediasoup Worker? Is this just a case of me not cleaning something up?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 19, 2020, 10:52am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890/2 "2020-10-19T10:52:06Z")

</div>

You didn’t say which mediasoup version. A related leak was fixed some weeks ago, please check the CHANGELOG in the source code of mediasoup to confirm.

---

<div class="post-metadata">

**Author:** ![gurupras](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/gurupras/32/738_2.png) [@gurupras](https://mediasoup.discourse.group/u/gurupras)\
**Post date:** [October 19, 2020, 11:00am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890/3 "2020-10-19T11:00:15Z")

</div>

Right! Sorry, this was on mediasoup `v3.6.21`. I believe the related leak you’re mentioning was fixed in this release?

If you can give me steps on how to collect any relevant information you need to investigate this further, I’d be happy to run them and share the results.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 19, 2020, 11:40am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890/4 "2020-10-19T11:40:42Z")

</div>

Well, let’s say the bug was not totally fixed in 3.6.21, so here the commit that should fix it:

- [https://github.com/versatica/mediasoup/commit/9576961a4250a5db1ca9a2a78dc4b9982a98ef3a](https://github.com/versatica/mediasoup/commit/9576961a4250a5db1ca9a2a78dc4b9982a98ef3a)

BTW mediasoup 3.6.23 released. Thanks for reporting.

---

<div class="post-metadata">

**Author:** ![gurupras](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/gurupras/32/738_2.png) [@gurupras](https://mediasoup.discourse.group/u/gurupras)\
**Post date:** [October 19, 2020, 11:56am UTC](https://mediasoup.discourse.group/t/help-with-identifying-memory-leak/1890/5 "2020-10-19T11:56:33Z")

</div>

Thank you!  
Can confirm that this is fixed 🙂
