[SIP Beyond VoIP] SylkServer uses too much memory
Saúl Ibarra Corretgé
saul at ag-projects.com
Thu Feb 14 13:09:07 CET 2013
On Feb 14, 2013, at 10:13 AM, Record Route wrote:
> Hi Saul,
>
> I sent INVITE's and for each INVITE Sylk instantiates new application instance before of "return app()" line
>
> I tracked as logging as below.
>
> @run_in_twisted_thread
> def handle_notification(self, notification):
> handler = getattr(self, '_NH_%s' % notification.name, Null)
> handler(notification)
>
> def _NH_SIPSessionNewIncoming(self, notification):
> session = notification.sender
> try:
> self.authorization_handler.authorize_source(session.peer_address.ip)
> except UnauthorizedRequest:
> session.reject(403)
> return
> try:
> app = self.get_application(session._invitation.request_uri, notification.data.headers)
> except ApplicationNotLoadedError:
> session.reject(404)
> else:
> log.msg('sys.getrefcounts(app) %s' % sys.getrefcount(app))
> app.incoming_session(session)
>
If you print the app object you get every time, you'll see that it's actually the same object. No new instances are created, __new__ will give you the one that was created in the first place. I also added a log line like yours and I always get 3 printed, so I don't think the leak comes from here.
Thanks for trying to help out!
--
Saúl Ibarra Corretgé
AG Projects
More information about the SIPBeyondVoIP
mailing list