Date: Fri, 6 Mar 1998 21:06:13 -0800 (PST) From: Bill Paul <wpaul@FreeBSD.ORG> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc/yp yplib.c Message-ID: <199803070506.VAA08565@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
wpaul 1998/03/06 21:06:12 PST Modified files: lib/libc/yp yplib.c Log: Fix resource allocation problems: - Completely recoded the ypmatch cache code. The old code could leak memory: it would allow the cache to grow, but never shrink. The new code imposes the following limits: o The cache is capped at a limit of 5 entries. o Each entry expires after five seconds, at which point its slot is freed. o If an insertion is to be done and all five slots are filled, the oldest entry is forcibly expired to release its slot. Also, the cache is implemented on a per-binding basis rather than having a global cache covering all bindings. This means that each bound domain has its own 5 slot cache. - Changed clntudp_create() to clntudp_bufcreate() so that the xmit/recv message buffer sizes can be set explicitly. NIS transactions are rarely much larger than 1024 bytes since YPMAXRECORD is 1024. The defaults chosen by clntudb_create() are actually much larger than needed. I set the xmit buffer to a little over 1024 and the recv buffer to a little over 2048. This saves a few Kbytes for each NIS binding. - Add my name to the copyright. I think I've made enough changes to this file to merit it. :) Note: these changes should go into the 2.2.x branch, but I'm waiting on feedback from a tester to see if the cache fixes solve the reported memory leak problem. Revision Changes Path 1.30 +178 -96 src/lib/libc/yp/yplib.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199803070506.VAA08565>