Re: non-pooled memory allocations

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 23 Oct 2001 18:10:41 +0200

Adrian Chadd wrote:

> Yeah with all the memAlloc() calls done during the storeClientCopy()
> calls in client_side.c , its evil. In any case, thats one of the things
> I'm looking to fix in commloops.

I have no huge problem with memAlloc() apart from us doing WAY to many
of them per request which wastes CPU. I have a problem with the still
relatively large amount of xmalloc/xcalloc/xstrdup calls being done per
request.

Some counts wile browsing briefly on the web (35 requests):

memPoolAlloc: 5100 (146 per request, huh..)
xmalloc: 317 (9 per request)
xcalloc: 63 (2 per request)
xstrdup: 264 (8 per request

xmalloc and xstrdup is a bit high, so lets see from where these are
called..

xmalloc: 440
   196 arrayGrow Array.c:122
       196 arrayAppend Array.c:94
           195 httpHeaderAddEntry HttpHeader.c:587
             1 memPoolFree MemPool.c:265
   114 storeSwapTLVAdd store_swapmeta.c:44
    46 xstrndup util.c:623
    46 parseHttpRequest client_side.c:2546
    46 parseHttpRequest client_side.c:2449
    38 storeSwapMetaPack store_swapmeta.c:97

xstrdup: 373

    46 urlCanonical url.c:392
    46 httpRequestFree client_side.c:794
    46 clientReadRequest client_side.c:2893
    46 clientAccessCheckDone client_side.c:230
    44 new_MemObject store.c:122
    44 new_MemObject store.c:118
    43 commConnectStart comm.c:269
    31 ipcacheCreateEntry ipcache.c:194
    25 pconnNew pconn.c:73
     1 ipcacheParse ipcache.c:317
     1 fwdConnectDone forward.c:202

Regards
Henrik
Received on Tue Oct 23 2001 - 10:20:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:35 MST