From owner-cvs-all Fri Mar 6 21:07:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA24365 for cvs-all-outgoing; Fri, 6 Mar 1998 21:07:55 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA24360; Fri, 6 Mar 1998 21:07:54 -0800 (PST) (envelope-from wpaul@FreeBSD.org) From: Bill Paul Received: (from wpaul@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id VAA08565; Fri, 6 Mar 1998 21:06:13 -0800 (PST) Date: Fri, 6 Mar 1998 21:06:13 -0800 (PST) Message-Id: <199803070506.VAA08565@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-lib@FreeBSD.ORG Subject: cvs commit: src/lib/libc/yp yplib.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message