From owner-freebsd-questions@FreeBSD.ORG Sat Jan 9 04:49:25 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADC91065672 for ; Sat, 9 Jan 2010 04:49:24 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id 4B2DD8FC0A for ; Sat, 9 Jan 2010 04:49:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id o094mxO4039834; Sat, 9 Jan 2010 15:49:00 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Sat, 9 Jan 2010 15:48:59 +1100 (EST) From: Ian Smith To: Bruce Cran In-Reply-To: <20100106161655.389A310656C3@hub.freebsd.org> Message-ID: <20100107194545.A8593@sola.nimnet.asn.au> References: <20100106161655.389A310656C3@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org, Da Rock Subject: Re: Tuning for very little RAM X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 04:49:25 -0000 In freebsd-questions Digest, Vol 292, Issue 8, Message: 13 On Wed, 6 Jan 2010 15:52:59 +0000 Bruce Cran wrote: > On Tue, 05 Jan 2010 20:03:45 +1000 > Da Rock wrote: > > > Its been a while- work's has been keeping me very busy for months now. > > > > I have revived an old laptop which has very little RAM, and it is > > absolutely hammering the swap. > > > > I'm trying to set it up as a demo for some skeptics with no money, so > > I need email, internet (with plugins), openoffice, acrobat, and wine. [Rock, mate, you may be on a hiding to nothing trying to run X apps in 100MB (128MB fitted I guess?) while setting yourself up as the advocate of an OS they're going to think is soooo slow .. but that's just me :-] With a lightweight wm it may be better, but you're talking about some big apps. OTOH, 256MB is plenty for that sort of usage; any chance of adding more RAM to it? Even another 32MB will really help .. > > Aside from all that though, for the academics of it how can I help > > this situation? The laptop has around 100MB RAM, with 16k free, and > > has a new install of FreeBSD 8.0. I just manage with 160MB on a old Celeron 300 laptop whose prime mission is pppoe, firewall, nat and routing for the LAN, half a dozen obscure websites, DNS, mail and such .. plus until now, KDE 3.5 on Xorg 6.9 on 5.5-STABLE. Just! That with 30-40% swap (of 384MB) in use, but mostly static, eg 6 more Konsoles I'm not using just now, 5x minimised kwrites for sources I may edit a few times a week, stuff like that stashed away in swap, using very little resident memory, ie not as bad as it looks :) > You can save a bit of memory by building a custom kernel. First, remove > any options you don't need such as INET6, NFS, AUDIT etc. Then, you can > replace "device ata" with more specific drivers, and "device mii" with > specific PHY drivers for your NIC. On a 128MB box I have that's running > 8-STABLE my kernel is just 4.1MB. Indeed. That's no bigger than my trimmed 5.5 kernel, good to hear. > You should also be able to build Xorg so it'll use less memory - for > example by not requiring hald but getting it to read the > configuration from xorg.conf instead. Again talking on the margins of usability, I notice that the Xorg with 7.0-RELEASE (X server 1.4.0) only used similar memory to 6.9 (30-50M, say 20M resident), but on 8.0-RELEASE (X server 1.6.1) top shows SIZE 126M RES 115M .. on a 256MB laptop, eek! It's a HAL-free config, though installed from packages so not at all optimised. Will try that later, while I'm hunting for 1G RAM at a decent price for it (Thinkpad T23) > You can also tell FreeBSD to agressively swap idle processes out by > setting vm.swap_idle_enabled to 1. Thanks for this, Bruce; I hadn't come across it before, or missed it. This has had an amazing and so far apparently only beneficial effect on the 5.5 box. At 127d uptime, I crossed my fingers and set that, to see swap drop from its then steady 46% (~15 mozilla tabs open, past time to restart the leaky thing anyway :) to below 40% in a matter of minutes. A little extra (async) swap in/out activity for sure, but contrary to expectations it's noticeably more responsive to things like switching desktops/windows on a slow machine already under swap stress, and even somehow(?) has increased idle CPU in top by about 3% to over 90%! cheers, Ian