ReducingMemoryUsage
From DSL Wiki
- This page in other languages: EspaƱol
Contents |
Introduction
The pourpose of this page is th gather useful information about low RAM DSL systems.
The rationale is that, being DSL's main feature its small size, it becomes an obvious choice for low RAM systems. You might find here informations technically not DSL-related, but still relevant as stated in the previous rationale.
There are many ways to minimize and maximize the available system resources (like RAM) by adjusting what you run. Maximizing usage is pretty easy: just run many applications simultaneously and that does the trick, you'll soon be out of RAM and your system will bog down. Most of the time, though, you're more likely to encounter issues where you want more RAM available for larger applications or to run a lot of smaller ones together.
I Lucky13 normally use DSL with a standard hard drive install on a 400 mhz Celeron "machine" (I use that term VERY loosely) with 128 MB RAM and a 282 MB swap partition. This is an older computer that I wouldn't put more money into with RAM upgrades, etc. I just want it to be functional and useful for the things I need and like to do.
Here is some advice for getting more out of your older machine.
Free (command)
First, open a terminal and type "free." That will show you your current memory use. Start closing applications you have opened. Each time, go to your "free" terminal and type "free" and see how much difference it makes. You can open other applications and check to see if they eat up too much RAM or if you can live with them.
Memory Hogs
I decided to test out my old computer using several different combinations of applications I normally run in X. I wasn't too surprised by my results:
- Mozilla products are pigs that eat up RAM
- XMMS uses way more memory than cplay or straight-up mpg123 (or mpg321 which comes with DSL)
- rox filer is fun for managing mp3 players, but mc, fdclone, clex, etc., are far easier on resources and can do the same job
- WindowMaker isn't a "light" window manager compared to fluxbox, jwm, ratpoison, etc.; and so on.
Console Applications
I'm comfortable using console apps, and I've run screen for weeks on end using startx only as needed (mainly for browsing, using non-pop web e-mail accounts, etc.). The main drawback to using console apps exclusively in 2007 is that much of the content I want and need is graphical, and many sites aren't suitable for viewing in w3m, elinks, links, lynx, netrik, or other nifty little browsers.
I've also run my console apps in screen while using ratpoison so I don't have to startx and then go back to the console, which works pretty well until I switch window managers and all my apps open to full screen. That's disalarming but not a problem.
RAM-Saving Ideas
Here are more RAM-saving ideas
- If you're using fluxbox, switch to one of the more basic-looking themes. Use wallpaper.lua (found in the setup-desktop submenu) to set your background to a solid color rather than using an image with the theme. Restart fluxbox (exit submenu-restart). Go to the terminal and type "free" again. See how much that changes things -- all of that loads into RAM, so you use more RAM the fancier you let things get
- Also turn off the icons. I don't know how much memory xtdesktop uses, but I occasionally use rox pinboard. You can take advantage of either xtdesktop or rox by using them as-needed: for the icons that come with DSL, you would open the icon tool and turn them on and off; for something like rox' pinboard, it would be easy to set up menu entries that let you turn on and off as needed.
- A computer shouldn't crash from browsing or using the internet. Dillo lacks a lot of function, but it's very fast and uses considerably less RAM than Firefox or Mozilla/Seamonkey. Opera uses considerably less RAM because it uses the same window to manage email and browsing (the extra windows from running Mozilla/Seamonkey or Firefox plus Thunderbird cost you quite a bit more RAM). Use Sylpheed for email if you want a GUI MUA.
- Edit /etc/inittab and comment out tty2,tty3, and tty4, leaving tty1. This will save around 3MB of RAM
(Thanks, InfinityCircuit)
- Mount your non-root ext2/3 fileystems (e.g. /home) with the "noatime" option, which will save memory when you edit files. (Thanks again, InfinityCircuit)
Optimizing Firefox
WDEF EDIT: If you must run Firefox, there are a few things you can do to reduce its memory consumption.
- Pick an alternative. If you're primarily reading text on the web, consider running one of the text browsers. From the DSL repository, I use snownews for RSS feeds. I have it set up with elinks (compiled from source) and my secondary browser, in case I need to see images, from elinks is Dillo (I like elinks because I download a lot of podcasts and it lets me do that in the background). Use wget in a terminal to download files, etc. GUIs are nice and easy to use, but they can eat up RAM in a hurry.
If you can live on the console without X, consider downloading screen.dsl and running console apps. Screen is a multiplexer that lets you run virtual terminals for console apps and manage them (though it's not really a window manager for console). Using screen lets you continue to run those apps in the same terminal when you startx, so you don't have to stop what you're doing in the console. You just resume your screen session in one aterm, xterm, etc., while in X and everything's still running when you go back to the console. It works very well with the console apps that come with DSL, like naim and mc. There are also console apps like elmo (for email) and epic4 (irc client) in the repository; there are more you can find through apt-get or compile (if you install gcc from the repository). Screen works better with window managers that don't have a lot of default (or user-added) keybindings because console apps lose their usefulness when a window manager uses the same keystrokes (window manager takes priority on keybindings); the best in this regard, imo, is ratpoison because it uses similar bindings to screen (ctrl-t-_ versus ctrl-a-_), but it may not be to your liking since it only manages windows in full screen mode -- so everything in gimp opens in its own window, including progress bars -- without a menu (though you can add one like ratmenu) and is geared for keyboard-only/mouseless use.
Other pending topics (to be included)
- RAM usage by applications (consumptions best measured under DSL)
- RAM usage by different DSL-extention types (information already available on this wiki, just need to link it here)
- Usage of RAM by DSL under different configurations (cheatcodes, boot tweeks, ...) and conditions.
Advice at the End
DSL should work admirably on machines lacking large amounts of RAM. It's all the stuff we pile on top of it that bogs it down. There are crazy people who want to put big fancy distros with 2.6 kernels on older hardware -- they may as well try to run XP or Vista with all the eyecandy they expect from those distros -- and aren't necessarily going to get better performance than they had using Win95, especially if they try to run KDE/Gnome with apps like Firefox and Thunderbird and Open Office. At the end of the day, they still have an old and sluggish computer because they're tying up their system resources with applications that are suited for computers with more resources.
Match your apps to the equipment you have and you'll do fine.
More (external) Info
- Here's an IBM's article containing useful ideas, information, methods and data on messuring and reducing GNU/linux RAM footprint.
Thin clients
This wiki is about DSL and DSL is ment for stand alone machines. They usually might be networked, but they still remain stand alone computers. Using resource-shortened computers as thin clients of more powerful desktop servers is indeed a very good choice, but it won't be handeled here. Please, search the wikipedia or any web search engine for keywords like thin client, LTSP, PXES, TCOS, a.s.o.