
Rob OpenSuSE wrote:
2009/1/12 Larry Stotler <larrystotler@gmail.com>:
On Mon, Jan 12, 2009 at 3:02 PM, Matt Sealey <matt@genesi-usa.com> wrote:
If you have 4GB or 8GB of memory it is nothing to care about, but users put in this memory to run applications, not to provide space for 50 boot services which sit idle, most of which are only there to provide people with large amounts of memory to get things done quicker. This is not very friendly to those who run in more constrained environments. I'm not looking for GNOME etc. to run in 128MB (although in 10.3 it did, and I had enough memory left to run applications before swapping) but reducing the memory footprint of the basic install would be awesome.
Linux does not swap!!! It's a demand paged virtual memory system. Those "idle" processes, will relinquish their clean pages, to be re-read in on demand by page faults from disk, and anonymous dirty pages can be saved in the (misnamed) swap space by the VM.
I really don't think there is any distinction to be made here. You swap a page in physical memory for one on some backing store. The terminology is naive but correct.
Unfortunately the value of "swappiness" set, seems to be 60, which according to my tests appears too low, so that even on a 512MiB system, swap space is generally unused, for typical "netbook" like usage. Increasing the value to 95 or 100, did get some pages written to the swap space, thus increasing the memory available for applications and kernel caches.
On a 128MB system it gets there pretty fast; on 10.3 we had ~40MB space left (which was then soaked by buffers and caches as is good to do). However loading anything else in started really going at the page file. On a slow disk this is an absolute nightmare. There are two schools of thought on this; one, is that applications should be stored in RAM and RAM only until significant memory pressure arises. The other, is that data should live mostly in swap and only be put into RAM when it's actually used. Windows likes to keep it the second way and there is a kernel developer who likes swappiness set really high (I forget his name.. was it Andrew Morton?). As long as you have enough of a swap cache and a fast enough disk this is awesome. I actually think this is the right way to do it. However, if your disk is slow (USB, NFS, DMA-less ATA), you're pretty much tied to how fast your disk is, which is.. very bad indeed. Couple it with a low amount of memory, and you basically have no way out.
This is the same problem that windows has. Too many apps think they are the most important thing you'll never use.
Any Specifics?
There are none :D Applications should allocate all the memory they'll need and the OS should work out what to do with it. As things like KDE and GNOME create more and more tasks and external applications and rely on more services, the memory consumption of the original tasks may go down, but it is then canceled out by the memory consumption of the extra feature and extra external application, plus any abstraction layered between. We're not talking anymore about "KDE uses too much memory as an application" but "SUSE loads far too much on boot". It's not just the desktop.. it's every service, every module, that is installed by default and enabled by default, which significantly reduces the amount of memory available for future tasks. Since most of them are essential to start other required boot services not much can be done about it, but definitely things like postfix are too big for the job they're meant to do (supply a dependency for cron) and certain boot tasks can be and should be deferred until the actual need arises before being started. Networking need not be brought up - i.e. access to the internet etc., since you need lo set up for a lot of things - until the user is at the desktop. On a Netbook this may be the wireless card, and they may have to pick an SSID first. Imagine that you do this on boot, on a new location - it sits in a console, trying to access an SSID it remembered from the last time. It doesn't exist. It has to scan.. and then fail. If it exists (maybe an unsecured network with a common name such as "NETGEAR", it still has to scan for it then configure and run DHCP over it, and potentially fail. This will increase boot time only so the user can get to a desktop and pick the right SSID and connect to the correct network as they wish. Unless you are booting into a system which does it's user authentication over the network (Active Directory, LDAP, or crazy people who still use YP etc.) then you don't need to bring up the network until they first start an app that needs networking. On openSUSE this may be the Updater app, although it SHOULD sit and wait for something else to access the internet (i.e. notification from NetworkManager that a connection was made and verified up, rather than forcing network access). On demand is definitely a good way to go for anything, as it reduces memory requirements up to the point something needs to be done. If you do not have enough memory to do it at that point, then tough luck.. time to buy new RAM. But if you never use it (Avahi for example, I have no mDNS-compatible devices here) and never go to a share browser or go to print a file, it shouldn't even be loaded.. the moment I do get one of these lovely little printers or a Mac sitting here, I want to be able to use it. Having the stuff on disk is great, loading it at boot and soaking xMB of memory until that point, is wasteful. -- Matt -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-factory+help@opensuse.org