Date: Mon, 12 Oct 1998 11:06:12 -0700 From: David Greenman <dg@root.com> To: Kevin Day <toasty@home.dragondata.com> Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/8275: w/top/etc randomly fail with 'Cannot allocate memory' Message-ID: <199810121806.LAA01216@implode.root.com> In-Reply-To: Your message of "Mon, 12 Oct 1998 09:00:01 PDT." <199810121600.JAA21354@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> > "home.dragondata.com" <root@shell1.dragondata.com> writes: > > > bash-2.02# w > > > 1:10PM up 19 days, 54 mins, 7 users, load averages: 0.08, 0.48, 0.73 > > > USER TTY FROM LOGIN@ IDLE WHAT > > > w: kvm_getprocs: Cannot allocate memory: Cannot allocate memory The problem is caused by the process table growing while w/top is trying to read the data. Via kvm_getprocs, which is a libkvm library function, they first make a syscall to determine how much memory is needed, and then after allocating the appropriate amount of memory, do another syscall to get the data. In-between the calls, the process table changed and made the needed amount of memory assumption invalid. kvm_getprocs gives up too easily. It should retry the above procedure a few times before giving up. It should also add in some padding in order to make it a bit more resilient to minor increases in the number of processes in the system. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810121806.LAA01216>