Memory Leak - Activity objects not disposed in SmppSession.cs
Posted: Fri Nov 28, 2025 2:52 pm
Hi alt,
We discovered a memory leak in our production environment. Memory grows from ~2GB to 3.6GB over one week and never releases.
Environment:
- Inetlab.SMPP version: 2.9.35
- .NET 8
- Linux
Memory profiler shows DiagNode<ActivityEvent> objects accumulating: see image1.jpeg
Memory growth over time: see image2.jpeg
Root Cause Analysis:
Found issue in SmppSession.cs - Activity objects not disposed for throttled requests.
Line 960 - throttled path:
_ = SendResponseAndDelayedRequests(resp, null, activity, _cancellationTokenSource.Token);
Activity is created at line 933 but SendResponseAndDelayedRequests never disposes it. Only HandleReceivedRequest disposes activity at line 718, but throttled requests bypass this method.
Can you please review and confirm?
Thank you.
We discovered a memory leak in our production environment. Memory grows from ~2GB to 3.6GB over one week and never releases.
Environment:
- Inetlab.SMPP version: 2.9.35
- .NET 8
- Linux
Memory profiler shows DiagNode<ActivityEvent> objects accumulating: see image1.jpeg
Memory growth over time: see image2.jpeg
Root Cause Analysis:
Found issue in SmppSession.cs - Activity objects not disposed for throttled requests.
Line 960 - throttled path:
_ = SendResponseAndDelayedRequests(resp, null, activity, _cancellationTokenSource.Token);
Activity is created at line 933 but SendResponseAndDelayedRequests never disposes it. Only HandleReceivedRequest disposes activity at line 718, but throttled requests bypass this method.
Can you please review and confirm?
Thank you.