Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
topoh: PKG memory leak #2027
I've noticed PKG memory increasing since enabling the topoh module last week in a significant manner (~7MB per worker over 3000 calls split between 4 workers). Removing the topoh module removed the memory usage.
Here is a pkg dump of one of the process post 3000 calls:
Discussion before reaching this conclusion:
I'm unsure why it's tagged dirty, as I simply cloned master and reset to 6d43eac.
I do plan to test this on dev7, however an unrelated issue is preventing me from testing this with my app_ruby based code. I will update if/when I am able to do this.
This may have been a result of having two modules using the same callback to update the content of the outbound buffer, in your case the topoh (hiding header attributes) and dialog (updating the cseq).
I pushed a bunch of patches to core and modules using this callback. They are in master branch for now. Can you test? If all ok I can backport.
Hi @miconda. Thanks so much for this!
I tested with kamailio 5.3.0-dev7 (x86_64/linux) 4c537a
Unfortunately after ~ 20 hours/10k calls:
I somehow lost the dump I took initially, however please find attached graph using the flawed methodology I used previously of summing together all children memory usage. Even though it's not a great measurement, it does prove the continued growth:
The version you used is before the fix -- the commit id in your version points to:
To have the version with the fix, it has to be after the commit:
Hi @miconda . I can confirm that this patch works. I put through ~ 4000 calls and roughly a 100kb increase in memory across all children (25kb each), and only as the first couple of calls came in. After that, 0 growth.
I believe this is fixed, thanks so much! I'll leave this open as you said you wish to backport.