From owner-freebsd-stable Thu May 9 7: 7:32 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mailc.telia.com (mailc.telia.com [194.22.190.4]) by hub.freebsd.org (Postfix) with ESMTP id 3E29937B40C for ; Thu, 9 May 2002 07:07:23 -0700 (PDT) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by mailc.telia.com (8.11.6/8.11.6) with ESMTP id g49E7LI13598 for ; Thu, 9 May 2002 16:07:21 +0200 (CEST) Received: from falcon.midgard.homeip.net (h53n2fls20o913.telia.com [212.181.163.53]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id QAA15695 for ; Thu, 9 May 2002 16:07:20 +0200 (CEST) Received: (qmail 28215 invoked by uid 1001); 9 May 2002 14:07:20 -0000 Date: Thu, 9 May 2002 16:07:19 +0200 From: Erik Trulsson To: MikeM Cc: freebsd-stable@freebsd.org Subject: Re: Steadily increasing memory usage on a lightly loaded server Message-ID: <20020509140719.GA28169@student.uu.se> Mail-Followup-To: MikeM , freebsd-stable@freebsd.org References: <200205090919510568.03BA6562@sentry.24cl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200205090919510568.03BA6562@sentry.24cl.com> User-Agent: Mutt/1.3.99i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, May 09, 2002 at 09:19:51AM -0400, MikeM wrote: > I'm running a web server that is lightly loaded, only about 15MB of > bandwidth usage per day. Ever since the recent kernel patches, I > have been noticing that the memory usage is slowly, but surely, > notching up. The server has about 700MB of memory. About a day > after a reboot, the top command shows all except for 40MB being used, > but I do not see any process that is using it. About three days > after a reboot, swap starts to be used, albeit only a little swap. > I've been running 4.5 on this server since it came out, and I never > saw these symtpoms until the recent kernel patches. How can I find > out what is using all this memory? > > Following are three snapshots: (1)dmesg (2)top command right after > a reboot (3)top command after 5 days of running. [snip dmesg] > > 2)top command right after a reboot *************************************** > last pid: 264; load averages: 0.07, 0.07, 0.03 > up 0+00:03:00 10:19:07 > 31 processes: 1 running, 30 sleeping > CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle > Mem: 11M Active, 10M Inact, 22M Wired, 32K Cache, 26M Buf, 707M Free > Swap: 500M Total, 500M Free [snip] > > (3)top command after 5 days of running.************************************ > last pid: 12100; load averages: 0.00, 0.00, 0.00 > up 5+22:26:36 08:42:43 > 33 processes: 1 running, 32 sleeping > CPU states: 0.0% user, 0.0% nice, 0.0% system, 0.0% interrupt, 100% idle > Mem: 23M Active, 618M Inact, 69M Wired, 40M Cache, 86M Buf, 1328K Free > Swap: 500M Total, 64K Used, 500M Free [snip] Looks normal to me. The memory that is marked as 'Inactive' is also available for allocation just as the 'Free' memory. In practice you can just add together the 'Inactive' and the 'Free' memory to get the total of free memory. The 'Inactive' memory contains data that *can* be reused (such as the code for programs that has recently been run) but that can also be thrown away without further notice if necessary. I wouldn't worry about swap being used either. FreeBSD tends to write some things to swap before it is actually *necessary* to do it. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message