From owner-freebsd-current@FreeBSD.ORG Mon Jan 15 14:58:36 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B5D816A6D1 for ; Mon, 15 Jan 2007 14:58:36 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-iport-2.cisco.com (sj-iport-2-in.cisco.com [171.71.176.71]) by mx1.freebsd.org (Postfix) with ESMTP id 554E213C44B for ; Mon, 15 Jan 2007 14:58:36 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-dkim-1.cisco.com ([171.71.179.21]) by sj-iport-2.cisco.com with ESMTP; 15 Jan 2007 06:58:36 -0800 X-IronPort-AV: i="4.13,190,1167638400"; d="scan'208"; a="356193441:sNHT49649240" Received: from sj-core-5.cisco.com (sj-core-5.cisco.com [171.71.177.238]) by sj-dkim-1.cisco.com (8.12.11/8.12.11) with ESMTP id l0FEwZTT031495 for ; Mon, 15 Jan 2007 06:58:35 -0800 Received: from xbh-sjc-211.amer.cisco.com (xbh-sjc-211.cisco.com [171.70.151.144]) by sj-core-5.cisco.com (8.12.10/8.12.6) with ESMTP id l0FEwZUw028891 for ; Mon, 15 Jan 2007 06:58:35 -0800 (PST) Received: from xfe-sjc-212.amer.cisco.com ([171.70.151.187]) by xbh-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 15 Jan 2007 06:58:33 -0800 Received: from [127.0.0.1] ([171.68.225.134]) by xfe-sjc-212.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 15 Jan 2007 06:58:33 -0800 Message-ID: <45AB9661.9040909@cisco.com> Date: Mon, 15 Jan 2007 09:57:37 -0500 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061029 FreeBSD/i386 SeaMonkey/1.0.6 MIME-Version: 1.0 To: current@FreeBSD.org References: <45AB9324.1030701@cisco.com> In-Reply-To: <45AB9324.1030701@cisco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 Jan 2007 14:58:33.0287 (UTC) FILETIME=[A04B3D70:01C738B5] DKIM-Signature: v=0.5; a=rsa-sha256; q=dns/txt; l=3603; t=1168873115; x=1169737115; c=relaxed/simple; s=sjdkim1004; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rrs@cisco.com; z=From:=20Randall=20Stewart=20 |Subject:=20VM=20Memory=20question |Sender:=20 |To:=20current@FreeBSD.org |Content-Type:=20text/plain=3B=20charset=3DISO-8859-1=3B=20format=3Dflowe d |Content-Transfer-Encoding:=207bit |MIME-Version:=201.0; bh=/IvxWFej/ZR5ZfYKIVV1uNt9HyYFZ3S83vM0HvAi0uQ=; b=jqR1WA/2OsCuu5Hnl/fIQT5+g5RVpxMgwD5xLCObXh9thc/PPaa90sWYxE9tdqDKoI4diw03 05+yzdOwDmvPwSoxo+KQhtVRXoTkAODIuzFEEBernhSzOYaKHOcXFT/qxiN1cUyq1QQWbgkc7O UQU8HXnuALJxaKfEgGDouPW+w=; Authentication-Results: sj-dkim-1; header.From=rrs@cisco.com; dkim=pass (sig from cisco.com/sjdkim1004 verified; ); Cc: Subject: VM Memory question X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 15 Jan 2007 14:58:36 -0000 Having posted this to the wrong place.. :-0 Let me redirect it to the right one :-) Randall Stewart wrote: > Hi all: > > I am looking at a memory problem.. i.e. maybe a leak somewhere.. > > I wrote a script in kgdb to get malloc and zone info. > Now I am not all that familiar with these structures > but I think there may be an issue.. either that > or I just don't understand what I am reading :-) > > The big standout to me is: > > zone:0xc145f1e0 pages: 14092 keg_free: 0 size:16384 alloc: > 12446364 frees: 12446297 fail: 0 biu:57720832 > -------------------------------------------- > > From my limited understanding.. pages aka keg->uk_pages > tells me I have a huge number of pages in the zone > coming out to about 57Meg of memory.. wow! > > > Now this zone is really: > ----------------------------------------------- > $3 = (struct uma_zone *) 0xc145f1e0 > (kgdb) print *$3 > $4 = { > uz_name = 0xc090c41b "mbuf_jumbo_16k", > uz_lock = 0xc1461188, > uz_keg = 0xc1461180, > uz_link = { > le_next = 0x0, > le_prev = 0xc14611ac > }, > uz_full_bucket = { > lh_first = 0xc6a64c48 > }, > uz_free_bucket = { > lh_first = 0xc6a3b624 > }, > uz_ctor = 0xc06888ec , > uz_dtor = 0xc06889c4 , > uz_init = 0, > uz_fini = 0, > uz_allocs = 0xbdea9c, > uz_frees = 0xbdea59, > uz_fails = 0x0, > uz_fills = 0x0, > uz_count = 0x80, > uz_cpu = {{ > uc_freebucket = 0xc6a3f20c, > uc_allocbucket = 0xc6a35000, > uc_allocs = 0x291, > uc_frees = 0x295 > }} > } > ------------------------------------ > > Now looking at the allocs/frees.. and subtracting we > only have (according to the zone) 67 that are not free.. > > The keg looks as follows: > ---------------------------------------- > $5 = { > uk_link = { > le_next = 0xc1461100, > le_prev = 0xc1461200 > }, > uk_lock = { > mtx_object = { > lo_name = 0xc090c41b "mbuf_jumbo_16k", > lo_type = 0xc09099e2 "UMA zone", > lo_flags = 0x1430000, > lo_witness_data = { > lod_list = { > stqe_next = 0xc0a06be0 > }, > lod_witness = 0xc0a06be0 > } > }, > mtx_lock = 0x4, > mtx_recurse = 0x0 > }, > uk_hash = { > uh_slab_hash = 0xc6a4b000, > uh_hashsize = 0x1000, > uh_hashmask = 0xfff > }, > uk_zones = { > lh_first = 0xc145f1e0 > }, > uk_part_slab = { > lh_first = 0x0 > }, > uk_free_slab = { > lh_first = 0x0 > }, > uk_full_slab = { > lh_first = 0xc692b5b0 > }, > uk_recurse = 0x0, > uk_align = 0x3, > uk_pages = 0x370c, > uk_free = 0x0, > uk_size = 0x4000, > uk_rsize = 0x4000, > uk_maxpages = 0x0, > uk_init = 0xc0829b90 , > uk_fini = 0xc0829ba8 , > uk_allocf = 0xc0826f40 , > uk_freef = 0xc08270ac , > uk_obj = 0x0, > uk_kva = 0x0, > uk_slabzone = 0xc14731e0, > uk_pgoff = 0x0, > uk_ppera = 0x4, > uk_ipers = 0x1, > uk_flags = 0x508 > } > ---------------------------------- > > So where is all the memory hiding? > > And if its free (as the zone implies) why is it > not getting released back to the system... (the machine > crashed with a "no memory" condition.. > > ??? > > Help from someone with a clue would be much > appreciated :-) > > Thanks > > R -- Randall Stewart NSSTG - Cisco Systems Inc. 803-345-0369 803-317-4952 (cell)