From owner-freebsd-bugs Mon Oct 12 11:08:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA06572 for freebsd-bugs-outgoing; Mon, 12 Oct 1998 11:08:03 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA06542 for ; Mon, 12 Oct 1998 11:07:54 -0700 (PDT) (envelope-from root@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id LAA01216; Mon, 12 Oct 1998 11:06:13 -0700 (PDT) Message-Id: <199810121806.LAA01216@implode.root.com> To: Kevin Day cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/8275: w/top/etc randomly fail with 'Cannot allocate memory' In-reply-to: Your message of "Mon, 12 Oct 1998 09:00:01 PDT." <199810121600.JAA21354@freefall.freebsd.org> From: David Greenman Reply-To: dg@root.com Date: Mon, 12 Oct 1998 11:06:12 -0700 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > "home.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