From owner-freebsd-current@freebsd.org Wed Feb 3 19:41:22 2016 Return-Path: Delivered-To: freebsd-current@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 DC0A1A9B00B for ; Wed, 3 Feb 2016 19:41:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id C80BCF7 for ; Wed, 3 Feb 2016 19:41:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 3CD5D564A4 for ; Wed, 3 Feb 2016 13:41:22 -0600 (CST) Subject: Re: Kernel memory leak with x11/nvidia-driver To: FreeBSD Current References: <56B230CB.3050600@FreeBSD.org> From: Eric van Gyzen Message-ID: <56B257E1.9070000@FreeBSD.org> Date: Wed, 3 Feb 2016 13:41:21 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <56B230CB.3050600@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2016 19:41:23 -0000 On 02/03/2016 10:54, Eric van Gyzen wrote: > I just set up a new desktop running head with x11/nvidia-driver. I've > discovered a memory leak where pages disappear from the queues, never to > return. Specifically, the total of > v_active_count > v_inactive_count > v_wire_count > v_cache_count > v_free_count > drops, eventually becoming /much/ less than v_page_count. Here is a script to log the data: #!/bin/sh readonly QUEUES="active inactive wire cache free total" readonly FORMAT="%s\t%s\t%s\t%s\t%s\t%s\n" vm_page_counts() { for queue in $QUEUES; do if [ "$queue" != "total" ]; then sysctl -n vm.stats.vm.v_${queue}_count fi done } sum() { s=0 while [ $# -gt 0 ]; do s=$((s + $1)) shift done echo $s } print_counts() { counts="`vm_page_counts`" printf "$FORMAT" $counts `sum $counts` } printf "$FORMAT" $QUEUES print_counts while sleep 60; do print_counts done