Skip to content

Fix memory leak with nackCountLogs - #386

Merged
JoTurk merged 1 commit into
masterfrom
pch07/fix-nackcountlogs-mem
Dec 2, 2025
Merged

JoTurk merged 1 commit into
masterfrom
pch07/fix-nackcountlogs-mem

Conversation

@philipch07

@philipch07 philipch07 commented Dec 1, 2025 •

Copy link
Copy Markdown
Member

Description

nackCountLogs wasn't getting cleaned up properly in generator_interceptor.go from the nack package.

this is fixed in two ways:

  1. UnbindRemoteStream() can delete the respective nackCountLogs for the provided SSRC.
  2. in the loop() we can drop the nackCountLogs map if it's empty. This is particularly helpful if a lot of them get accumulated over time.

Reference issue

#328 and @joeturki mentioned that there were reports of a memory leak so hopefully this fixes it.

@philipch07 philipch07 changed the title Fix memory leak with nackcountlogs Fix memory leak with nackCountLogs Dec 1, 2025
@codecov

codecov Bot commented Dec 1, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.70%. Comparing base (8dddb51) to head (d12daa5).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #386      +/-   ##
==========================================
+ Coverage   79.45%   79.70%   +0.25%     
==========================================
  Files          84       84              
  Lines        4176     4179       +3     
==========================================
+ Hits         3318     3331      +13     
+ Misses        685      678       -7     
+ Partials      173      170       -3     
Flag Coverage Δ
go 79.70% <100.00%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@philipch07

Copy link
Copy Markdown
Member Author

This doesn't fix the deadlock problem from #384, but I think I just found it. I'll make a new pr for that (it's based on this pr though).

@philipch07
philipch07 force-pushed the pch07/fix-nackcountlogs-mem branch from c001ab2 to 0a69b6c Compare December 1, 2025 21:55

@Sean-Der Sean-Der left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang nice debugging/catch @philipch07!

@JoTurk JoTurk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I promised to test it again when i wake up it's working as intended 😄

@JoTurk
JoTurk merged commit d12daa5 into master Dec 2, 2025
@JoTurk
JoTurk deleted the pch07/fix-nackcountlogs-mem branch December 2, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants