[Live-devel] Memory leak in ProxyServerMediaSession
Dnyanesh Gate
dnyanesh.gate at intelli-vision.com
Thu Jul 30 04:34:38 PDT 2015
Hi,
Found a memory leak in class ProxyServerMediaSession. This leak grows with
more number of cameras registered to live555ProxyServer.
class PresentationTimeSessionNormalizer is derived class of Medium. So that
whenever object of class PresentationTimeSessionNormalizer is created, it
creates its new entry in HashTable.
But when ~ProxyServerMediaSession() is called
fPresentationTimeSessionNormalizer object is freed using delete operator
instead of Medium::close(); Because of this its entry is not removed from
HashTable and because HashTable is not empty, unable to reclaim
UsageEnvironment at end.
If live555ProxyServer has only one UsageEnvironment object, then its not an
issue, but if there are multiple UsageEnvironment objects (created when new
stream registered and reclaimed when stream disconnected), then it
generates memory leak per camera stream. This memory leak were causing a
crash in our live555ProxyServer after too many registering and
de-regestering camera streams.
Here is valgrind result (live.2015.07.23.tar.gz
<http://www.live555.com/liveMedia/public/live.2015.07.23.tar.gz>)
1. ProxyServerMediaSession.cpp:134 : delete
fPresentationTimeSessionNormalizer;
==13119== LEAK SUMMARY:
==13119== definitely lost: 1,040 bytes in 1 blocks
==13119== indirectly lost: 171 bytes in 5 blocks
(FIX)
2. ProxyServerMediaSession.cpp:134 :
Medium::close(fPresentationTimeSessionNormalizer);
==12990== LEAK SUMMARY:
==12990== definitely lost: 0 bytes in 0 blocks
==12990== indirectly lost: 0 bytes in 0 blocks
Please check whether this is a valid fix or not.
I hope this fix may help for live555 stability.
--
Thanks & Regards,
DnyaneshG.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150730/a7f52014/attachment.html>
More information about the live-devel
mailing list