I've earlier posted these patches for memory leaks, but they don't seem to
have been picked up. Perhaps this happened because I posted them in a thread
about a potential memory leak in the JAIN SIP library, while my changes
apply to the SIP Communicator code. Maybe you are interested in including
the changes before the alpha 2 release, so I thought to post again.
MediaServiceImpl keeps a reference to every CallSessionImpl which is ever
created. There's a TODO comment to remove closed calls The patch goes
the simplest route and simply comments out the line which adds the newly
created callSession to the list of activeCallSessions, which can be done
because activeCallSessions is not used. Perhaps activeCallSessions coud be
removed completely until the time it is needed?
The second patch deallocates and closes the players created during a
CallSession, which are currently only stopped.
The third patch decreases the impact of a memory leak in the SUN JMF
implementation, which stores custom codec formats in a static Vector and
thus never releases them even if the RTP manager on which the format is
registered is released.
I've found the patch by setting the JVM startup parameter
-XX:+HeapDumpOnOutOfMemoryError and then using Abbot (http://abbot.sf.net/)
to repeatedly start and end calls until I got an OutOfMemory error. I
analyzed the resulting heap dump with jhat, which is part of the JDK 1.6
Unfortunately, the Abbot scripts which I've used won't work with the plain
SIP Communicator, since I've been testing with our in-house application,
which merely calls out to the SIP Communicator SIP module.
memleak-MediaServiceImpl.patch (725 Bytes)
memleak-CallSessionImpl-1.patch (559 Bytes)
memleak-CallSessionImpl-2.patch (1.91 KB)