A RAM Dietary Program

I am lucky enough to have a very generous uncle and aunt, who recently wanted to buy me a new computer. In our conversation we talked a little bit about what kind of hardware requirements I had, and they were a bit confused when I told them that 8 Gigabytes of RAM was more then enough for my needs. My uncle, a Windows user I might add, claimed that he needed a workstation with a least 32 Gigabytes of RAM, since he needed to have many windows open at the same time across multiple screens. These windows ran applications like web browsers, PDF readers and documents being edited. Now in my workflow, I too run many windows open at the same time across multiple screens, including web browsers, PDF readers and documents being edited, but I seldom exceed a hundredth of that amount of memory. It got me thinking.

How much memory do various applications really use, and is it possible to save substantial computer resources by just changing a handful of application habits? Of course personal tastes and work requirements vary, so it's impossible to make any definitive guide, but the following is a list of general recommendations. If you drop the AVOID applications mentioned here, you will likely not use even 1 GB of RAM under a heavy workload, and if you adopt the RECOMMEND'ed ones, you will likely use under half a GB under heavy workloads.

Now you may be thinking; why? I have 8 Gigabytes of RAM, so why would I want to use 1, wouldn't it be a waste to have 7 GB unused? Well, no. That's a bit like saying that unspent money in the bank is wasted. It is actually very wise to modesty spend less then your income, not only do you save up for a rainy day, but it significantly reduces economic stress. Making a habit of using less memory will also make hardware specs largely irrelevant, you can be productive in front of any and all computers, even throw-away laptops that nobody wants. Also, having the extra memory does not hurt in situations where you need to do heavy lifting, compiling software or running virtual machines for instance. There are other benefits as well, running lightweight applications means that you have a very snappy system. Light programs usually have light manuals, and its significantly easier to debug them and send a patch upstream. Simple programs simplify your life. So, without further adieu, here is the RAM dietary program:

Operating System

  • AVOID: Windows
  • RECOMMEND: Any Linux or BSD (eg. Debian or FreeBSD)
  • SAVE: 1000+ Mb
  • Seriously, why on earth would you use Windows..? There are literally thousands of better alternatives out there, pick one.

    Games

  • AVOID: Triple A games on Steam (eg. Civ V)
  • RECOMMEND: Any opensource or retro game (eg. FreeCiv, Civ I in DosBox, vms-empire, etc...)
  • SAVE: 1000+ Mb
  • Now, I know it's hard, but changing your gaming habits may be the single most important step in reducing memory requirements.

    IDE

  • AVOID: NetBeans
  • RECOMMEND: Any text editor (eg. Geany, vi)
  • SAVE: 440 Mb
  • This is not a joke. Not only is it possible to do professional programming using basic UNIX tools, but it is arguably not possible to do it otherwise. Using bloated IDE's beyond your understanding, is a sure way to generate bloated code beyond your understanding. Keep things simple, for your own benefit, as well as others!

    Image Viewer

  • AVOID: DigiKam
  • RECOMMEND: Geeqie or Ristretto
  • SAVE: 340 Mb
  • Music Player

  • AVOID: Rhythmbox
  • RECOMMEND: Any CLI app (eg. moc or sox)
  • SAVE: 330 Mb
  • I have yet to see a lightweight graphical music player on UNIX-like operating systems. In fact, only a few use less memory then VLC! (eg. Potamus or DeaDBeeF) If you have to use a graphical program, VLC is a fair option, otherwise there are a ton of good and light command line audio players.

    Video Player

  • AVOID: Any web browser
  • RECOMMEND: MPlayer
  • SAVE: 100 Mb
  • MPlayer is the lightest of the opensource video players, but it will not play every media file or DVD (neither will the newer MPV fork).* VLC has large dependencies due to its Qt dependency, but the actual memory usage is not much worse then MPlayer. If you have to use a solid multimedia player with a graphical interface, VLC is the go to app.

    Reminder Service

  • AVOID: Online PIM tools (eg. Google Calendar)
  • RECOMMEND: calcurse or remind
  • SAVE: 310 Mb
  • Desktop

  • AVOID: KDE, Gnome or Xfce
  • RECOMMEND: Any Window Manager (eg. FluxBox or dwm)
  • SAVE: 300 Mb
  • One challenge in making the switch from a big desktop to a standalone window manager, is that you do not get a host of desktop utility programs, and often there are no good alternative lightweight GUI applications available. You can almost always do what you need though in a humble terminal though, with just a little bit of know how, see Desktop chores in the Terminal below.

    Web Browsing

  • AVOID: Firefox or Chrome
  • RECOMMEND: Dillo or any CLI browser (eg. links)
  • SAVE: 300 Mb
  • This is probably the hardest category to give any meaningful recommendations to. The modern web is a beast, and there just isn't any good alternatives out there. Lightweighters, such as Dillo or links, will not render anything beyond pure HTML. Midweighters, such as Midori or Reconq, has support for JavaScript and the like, but in practice a great many sites will not render correctly. And the memory usage of these midweighters is actually bad enough that I can't really recommend them in the first place. Your best bet is to try to avoid the internet as much as humanly possible. For example, download videos, music and documents, using wget or transmission-cli, and use these files with dedicated video, audio and document applications (eg. download Youtube videos with youtube-dl and watch them with mplayer). Use dedicated email, chat, office programs and games, rather then online solutions, and so on. Good luck, your gonna need it!

    Email Client

  • AVOID: Thunderbird, Evolution, KMail, online email
  • RECOMMEND: Claws-Mail or mutt
  • SAVE: 180 Mb
  • Personal Accounting

  • AVOID: LibreOffice or online office
  • RECOMMEND: Gnumeric or awk
  • SAVE: 130 Mb
  • PDF Reader

  • AVOID: Firefox or Chrome
  • RECOMMEND: XPDF or MuPDF
  • SAVE: 110 Mb
  • Update: Since XPDF moved over to Qt as its framework (version 4+), it is actually fairly bloated. Evince is probably the lightest graphical PDF viewer nowadays.

    Office

  • AVOID: LibreOffice or online office
  • RECOMMEND: Abiword or latex
  • SAVE: 100 Mb
  • If you don't mind being a bit weird, groff is probably the lightest office tool you can find, and it can do more then most people think.

    Task Manager

  • AVOID: KSysGuard (KDE)
  • RECOMMEND: Any CLI app (eg. top)
  • SAVE: 85 Mb
  • Chat Client

  • AVOID: VOIP
  • RECOMMEND: Text chat and EMail (eg. finch, irssi and mutt)
  • SAVE: 80 Mb
  • As with the web browsing category above; there are no "light" VOIP solutions. The only way to save computer resources here, is to communicate by alternative means. If you have to use VOIP, use dedicated software (eg. Zoom or Skype), not a browser solution (eg. Google Meet).

    File Manager

  • AVOID: Dolphin or Krusader
  • RECOMMEND: Xfe or mc
  • SAVE: 70 Mb
  • Terminal

  • AVOID: Konsole, Gnome-Terminal or Terminology
  • RECOMMEND: RoxTerm, XTerm or st
  • SAVE: 60 Mb
  • Archive Manager

  • AVOID: Ark (KDE)
  • RECOMMEND: Any CLI app (eg. tar, gzip, etc...)
  • SAVE: 60 Mb
  • Desktop chores in the Terminal

  • Date and Time: date
  • Calculator: bc -l
  • Spellcheck: aspell -c or spell
  • Check dictionary: wn word -over
  • Set screen resolution: xrandr
  • Take screenshot: scrot
  • Change keyboard layout: setxkbmap
  • Change background: xsetroot or feh
  • Adjust volume: eg. alsamixer (on Linux), mixer vol.volume=1.00 (on FreeBSD)
  • Check remaining battery: eg. acpi (on Linux), acpiconf -i 0 (on FreeBSD)
  • Check hardware specs: dmidecode
  • Set alarm clock: eg. sleep 600; play beep.mp3 or at 4 <RETURN> play beep.mp3 <Ctrl-D>
  • Start/stop timer: time read (hit Ctrl-D or Ctrl-C when done)
  • Send notification: wall message-file
  • Switch workspace: eg. Ctrl-Alt-F2
  • Window Management: tmux or dvtm
  • Record session: script or ttyrec
  • Analyze disk usage: ncdu, df or du
  • Sweep clean temporary files: eg. rm -rf ~/.cache ~/.local/share/Trash
  • Cancel a task: Ctrl-C or pkill program
  • Pause and resume a task: Ctrl-z, fg to resume
  • Progress bar: pv file > new_file or Ctrl-t (on FreeBSD)
  • You can often do casual chores in the shell with simple conventions. For example, do you need a todo list? Just write one in vi (nano is a good alternative if your new to Linux/UNIX). Need to mark the calendar? Just cal > calendar, and edit this file in vi. Need a phone book with contact information? Just write it in vi and grep for the name you want. Need a password manager? Just write your passwords in vi, encrypt it with gpg2 --symmetric, to search the database gpg2 --decrypt | grep it. Need to quickly jot down a sentence, and have the computer remind you of it later? Just add these two lines to your ~/.bashrc file:

    alias note='echo "$@" >> $HOME/.notes'
    if [ -f $HOME/.notes ]; then cat $HOME/.notes; fi
                

    You can now jot down a quick reminder with note remember to buy milk!, and you will be reminded of this whenever you login to your machine, until you delete the note (eg. rm ~/.notes). There are no icons or start menus in the terminal, but as the above example show, it is very easy to create your own commands (or "launchers" if you will). Creating menus is also quite possible if you want to, look up the select command in your shell's manual for instance. I am sure you can think of many useful conventions that are better honed to your own idiosyncrasies :^)

    Going even lighter

    It is possible to go even lighter, by dropping X all together and do your work in the text console, or TTY. In terms of memory usage, there isn't really much difference between various Linux distros and BSD variants on the desktop, but on bare TTY you can really notice it! A heavy workload with dozens of text and curses applications on a BSD TTY session, will hardly use even 100 Mb of RAM. And you can go even lighter then that: A heavy workload in Plan 9 or KolibriOS* will use about 50 Mb of RAM**, despite being graphical desktops! Now, these are very obscure operating systems, and I do not generally recommend then as a daily driver. But it is fun to know that a graphical desktop with many windows open, running web browsers, PDF readers and documents being edited, is quite possible using only 32 Mb of RAM, next time you hear a Windows user complain that 32 Gb doesn't quite cut it...

    *) Many who see the colorful KolibriOS Desktop using few Megabytes of RAM, will assume that assembly programming must be amazingly efficient. That conclusion is wrong. There are alternative operating systems written in higher level languages that can compete (eg. Inferno). The reason KolibriOS is so efficient, is not because it is written largely in assembly language, but because it is written from scratch. It avoids the truck loads of legacy junk that plague mainstream systems.

    **) Well... not counting filesystem caching and internal kernel memory, but that is usually excluded when UNIX and others measures memory, so I feel it's only fair to doctor these numbers in a similar way.