[8840] in Athena Bugs
AFS memory leak
daemon@ATHENA.MIT.EDU (Richard Basch)
Thu Jan 16 09:45:29 1992
Date: Thu, 16 Jan 92 09:45:03 -0500
To: afs-bugs@transarc.com, hamel@transarc.com
Cc: bug-afs@MIT.EDU, bugs@MIT.EDU
From: "Richard Basch" <basch@MIT.EDU>
The following patch fixes a memory leak that we have seen on our AFS-NFS
translators. The NFS daemons may have already decremented the ref count
of the credential structure down to 1 and this routine would then only
decrement it to 0. By calling crfree() instead, the proper handling is
achieved. crfree() decrements the reference count, and if it is zero,
will return it to the free pool. Bypassing crfree() caused a lot of
credential structures to be left around, and eventually the kernelmap
was filled.
I reported the bug about a memory leak in the translator, filling up the
kernelmap about 1.5 years ago, but somehow it was never addressed. We
finally had someone sit down and examine the problem full-time for about
2 weeks to discover this, and since then, our situation has vastly
improved.
-Richard
*** /tmp/,RCSt1E4YA9_ Thu Jan 16 09:37:00 1992
--- afs/afs_daemons.c Fri Jan 10 18:22:04 1992
***************
*** 358,364 ****
tb->vnode = (struct vcache *) 0;
}
if (tb->cred) {
! tb->cred->cr_ref--;
tb->cred = (struct ucred *) 0;
}
afs_BRelease(tb); /* this grabs and releases afs_xbrs lock */
--- 358,364 ----
tb->vnode = (struct vcache *) 0;
}
if (tb->cred) {
! crfree(tb->cred);
tb->cred = (struct ucred *) 0;
}
afs_BRelease(tb); /* this grabs and releases afs_xbrs lock */