From owner-freebsd-stable@freebsd.org Tue Mar 8 20:29:27 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29E68AC8311 for ; Tue, 8 Mar 2016 20:29:27 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 15647DA3 for ; Tue, 8 Mar 2016 20:29:26 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 3D4AA56A6E; Tue, 8 Mar 2016 14:29:20 -0600 (CST) Subject: Re: procstat -kk: Cannot allocate memory To: Garrett Wollman , freebsd-stable@freebsd.org References: <22239.13127.949472.929342@khavrinen.csail.mit.edu> From: Eric van Gyzen Message-ID: <56DF361F.5010800@vangyzen.net> Date: Tue, 8 Mar 2016 14:29:19 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <22239.13127.949472.929342@khavrinen.csail.mit.edu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2016 20:29:27 -0000 On 03/08/2016 14:17, Garrett Wollman wrote: > Sometimes when running "procstat -kk", I get the following error: > > procstat: sysctl: kern.proc.pid: 1044: Cannot allocate memory > > What is the condition that causes this? Is there a static limit in > procstat, or in the kernel, that needs to be increased? "Cannot allocate memory" from sysctl usually means the requested data grew between the two calls to sysctl. In this case, perhaps there are more stack frames during the second call than during the first. libprocstat should probably allocate a little more memory than the first sysctl prescribed, in order to accommodate this growth. Eric