[asterisk-dev] chan_sip.c - struct sip_pvt is very large...

Luigi Rizzo rizzo at icir.org
Sun Nov 12 14:16:48 MST 2006


On Sun, Nov 12, 2006 at 09:56:23PM +0100, Johansson Olle E wrote:
> 
> 12 nov 2006 kl. 21.41 skrev Luigi Rizzo:
> 
> > at first i missed it, but when i recently started playing with
> > the new container code it struck my eyes that
> > struct sip_pvt has size 5472 bytes (more if you include the lock and
> > link field).
> >
> > The culprit seems to be this large field
> > 	struct sip_request initreq
> > which alone consumes 4644 bytes (4096 of which are for
> > the packet buffer, sized SIP_MAX_PACKET)
> >
> > Given that this is always initialized from a known message
> > in initialize_initreq(), would it make sense to allocate it
> > with the exact size rather than with the default maximum size ?
> > Besides, this would also save time in initializing it,
> > as we don't have to copy the full block but only the data
> > actually used.
> >
> Open a branch and produce a patch for review!
> Thanks.
> 
> /O
> 
> ---
> Olle E. Johansson * Asterisk Evangelist, developer * VOOP A/S

and that's the evangelist preaching the procedure :)

but i was asking something different,
i.e. does anyone see any odd side effects in allocating
the initreq separately ?

cheers
luigi

> olle at voop.com
> 
> 
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev


More information about the asterisk-dev mailing list