[SIP Beyond VoIP] SylkServer uses too much memory

Record Route recordroute at gmail.com
Thu Feb 14 14:10:57 CET 2013


So, in python if no __new__ method is written than that object becomes
singleton in some words, right?

recordroute

On Thu, Feb 14, 2013 at 2:09 PM, Saúl Ibarra Corretgé
<saul at ag-projects.com>wrote:

>
> 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ag-projects.com/pipermail/sipbeyondvoip/attachments/20130214/684e862a/attachment.html>


More information about the SIPBeyondVoIP mailing list