[SIP Beyond VoIP] SylkServer uses too much memory

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


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)

On Thu, Feb 14, 2013 at 10:57 AM, Saúl Ibarra Corretgé <saul at ag-projects.com
> wrote:

>
> On Feb 14, 2013, at 8:09 AM, Record Route wrote:
>
> > Each time a request received by Sylk, get application method called by
> the __init__.py under sylk/applcation folder, and it instantiates
>  application instance time
> >
> >     def get_application(self, ruri, headers):
> >         if SYLK_APP_HEADER in headers:
> >             application = headers[SYLK_APP_HEADER].body.strip()
> >         else:
> >             application = ServerConfig.default_application
> >             if self.application_map:
> >                 prefixes = ("%s@%s" % (ruri.user, ruri.host),
> ruri.host, ruri.user)
> >                 for prefix in prefixes:
> >                     if prefix in self.application_map:
> >                         application = self.application_map[prefix]
> >                         break
> >         try:
> >             app = (app for app in ApplicationRegistry() if
> app.__appname__ == application).next()
> >         except StopIteration:
> >             log.error('Application %s is not loaded' % application)
> >             raise ApplicationNotLoadedError
> >         else:
> >             return app()         # This is the line I'm trying to
> mention.
> >
>
> Those are the application objects, which are indeed singletons, so memory
> won't grow after startup because they are instantiated only once throughout
> the lifetime of the process.
>
>
> --
> Saúl Ibarra Corretgé
> AG Projects
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ag-projects.com/pipermail/sipbeyondvoip/attachments/20130214/4a39b2ce/attachment.html>


More information about the SIPBeyondVoIP mailing list