From owner-freebsd-net@FreeBSD.ORG Wed Nov 30 03:20:41 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1DD9D16A41F for ; Wed, 30 Nov 2005 03:20:41 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id B7AA143D92 for ; Wed, 30 Nov 2005 03:20:30 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.200] ([10.0.0.200]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id jAU3KRpU069370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Nov 2005 19:20:28 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <438D1A99.6000803@errno.com> Date: Tue, 29 Nov 2005 19:20:57 -0800 From: Sam Leffler User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051126) X-Accept-Language: en-us, en MIME-Version: 1.0 To: nielsen@memberwebs.com References: <438CE0A8.4010205@memberwebs.com> <438D0896.1070808@memberwebs.com> In-Reply-To: <438D0896.1070808@memberwebs.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: Memory leak in net80211 on FBSD 6.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2005 03:20:41 -0000 Nate Nielsen wrote: > Nate Nielsen wrote: > >>I'm experiencing a memory leak in the net80211 code. I have two atheros >>5213-A cards on two embedded systems running FreeBSD 6.0. They are setup >>as IBSS (adhoc) stations. After roughly 15 seconds of ~14Mbps TCP >>traffic (single stream) I promptly run out of memory: >> >> >>>login: panic: kmem_malloc(4096): kmem_map too small: 25165824 total allocated >>>Uptime: 3m0s >>>Cannot dump. No dump device defined. >>>Automatic reboot in 5 seconds - press a key on the console to abort >>>Rebooting... >> >>The boxes have 64MB of memory each. >>vmstat -m reports the following just before the panic: >> >> >>> Type InUse MemUse HighUse Requests Size(s) >>> >>> 80211node 20554 20554K - 20559 512,1024 > > > I've put debugging code in node_alloc() and node_free() (in > net80211/ieee80211_node.c) and can confirm that thousands of > ieee80211_node structures are being allocated, at a cost of 1K a piece. > > I'll continue to look into this (stumbling about), but if anyone has any > advice or ideas of where to look, I'd be eternally grateful. Please don't spam lots of groups. I'm aware of the leak (David Young found it in netbsd) and have a partial fix. I'll send it to you directly. Sam