sean-cc / jain-slee

Automatically exported from code.google.com/p/jain-slee
0 stars 0 forks source link

SIP-RA leaks when UAS is unavailable #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Preconditions:
- Setup SIP11-RA (2.8.0-SNAPSHOT) with B2BUA example application

Actions:
- Generate load (with SIPP) from UAC but don't start UAS

Expected Result:
- Client Transactions/Dialogs should time because UAS is not available
- The system should be stable in terms of memory also when increasing the load

Real Result:
- Slee crashes after a while with memory problems
- Profiling revealed the Heap is filled up with "DialogWithoutIdActivityHandle" 
which are referenced from ActivityContextFactoryImpl.
- In this case the Dialog-Activities are never ended

Suggested Fix
- SIPResourceAdaptor-Implementation currently only ends those activities 
(invocation of endActivity Method) in processDialogTerminated-Method
- processDialogTerminated is never called from SIP Stack as the dialog is never 
really created within SIP Stack (See discussion in mobicents-public)
- Instead processTimeout is called from SIP Stack and can be used by SIP-RA to 
end the Dialog Activity

This piece of code can be included at the very end of processTimeout-Method:
--- code start ---
//End Activity because stack will not send DialogTerminated-Event in 
Timeout-Case
if (d != null && dw != null && d.getState() == DialogState.TERMINATED)
   endActivity(dw);
--- code end---

No leak can be reproduced anymore in this case after applying this fix

Attached are screenshots showing the memory profile before and after the fix as 
well as Debug logs of one single call, aswell as updated files for SIP B2BUA 
Example App to handle the Timeout Event also.

Also the fix itself is attached (SipResourceAdaptor.java) based on latest GIT 
Head Version.

Original issue reported on code.google.com by stephan....@kapsch.net on 2 Oct 2013 at 12:12

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jean.deruelle on 2 Oct 2013 at 12:30

GoogleCodeExporter commented 9 years ago
This issue was closed by revision dd0217701b5b.

Original comment by EMMart...@gmail.com on 30 Jul 2014 at 2:44

GoogleCodeExporter commented 9 years ago

Original comment by EMMart...@gmail.com on 30 Jul 2014 at 2:45