Windows; Linux and Memory

You often hear how much Linux like memory, and how much it eats up compared to Windows. It’s true! Linux eats into your memory, no matter how much you have, you never seem to have any free for applications to run in! I recently read an article where the author was complaining how Firefox ate into his memory under Vista. The sad fact of it is:

While Linux appears to eat more of your memory, it manages it much better than Windows does.

I have Firefox open right now, I have 10 tabs open with graphics intensive web sites. Firefox is claiming 200Mb of my precious memory… or is it? Actually no: real size in memory 90Mb.

The current list of the most memory intensive applications I’m running, and their “supposed” memory usage:

  • Java (Netbeans) 600Mb
  • Xorg 380Mb
  • Firefox 200Mb
  • Thunderbird 130Mb
  • Amarok 120Mb
  • Kwin (KDE) 120Mb

Now considering I only have 1.5Gb of memory in this machine that 50Mb to much, and considering there are a total of 120 processes running, I haven’t even started to cover the list. Now as any knowledgeable person will tell you, Linux is using some of the hard-drive and pretending that it’s memory, but since a hard-drive is slow, my computer will be running awfully slow.

Wrong! Yes, a disk is much much much slower than memory (especially a laptop drive like this one). However, my computer is running very very fast. Why? Linux’s memory manager notes what parts of memory are used frequently, and what parts are seldom accessed. This means that the parts that are used frequently stay in real memory, and the stuff no-one is using gets stored on the disk.

Translation: Linux will run much faster, and keeps things in memory in such a way as to speed things up! Under Windows, more free memory is better, under Linux it’s the opposite! Less free memory is better, since it means Linux is doing it’s job better.

Response to a Vista comment

This post is a response to the following comment, posted on my blog. Since the poster failed to leave any contact details, I feel I should post a comment here, since I’ve been meaning to follow up the Vista is a Linux Clone post for some time. I will be quoting from the comment in this post (so you can read the post here as I respond to it).

The Linux world is full of hearsay and conjecture, first off XP has been on the market longer than Suse.

SUSE Linux was first officially released in 1994 (and became a unique distro in 1996), Windows XP was released October 2001. That puts SUSE on the market 7 (or 5 if you take it from 1996) years before Windows XP.

Second all operating systems, tend to look the same regardless what company makes them. If beggars become choosers and looks is all the eye candy we can sue each other over, it’s like having two cold wars that literally cancel each other out.

I agree strongly that most Consumer Operating Systems do tend to look similar (with the notable exception of Mac OS). This is due to some basic user interface principals, mostly pioneered at Xerox Park. The fact is that Linux is ahead of any other Operating System when it comes to adoption of functionality. Many of the new features people are seeing in Vista or adaption of functionality that has existed in the Linux world for ages.

Also Vista is not all about just Directx 10, it has core features that make it more robust than most server distros. The fact you distro geeks have nothing better in mind, shows that you lack proper reasoning.

No, Vista is not about Direct X 10. But the fact that Direct X 10 sits underneath Vista’s entire graphics system, raises some serious security concerns with me. Direct X 10 almost replaces the traditional driver layer of the Operating System. To me it’s a bit like Microsoft executing games in unprotected mode on the XBox, in order to give a small performance boost, ie: just plain stupid. These layers have been put in place for a good reason, and have been built-up over decades. Why throw them away, or subvert them now?

Microsoft business solutions are actually worth the price, the reason I say this is because an operating system alone means nothing if its core features are not there. It comes packed with software that actually works, sure there are bugs in MS environment.

Hrm… Are you trying to sell me something here? Having looked at Vista in the stores, I wouldn’t pay any money for any version. There is no way on this earth that any software (other than maybe a few very large database or application server systems) could possibly be worth the amount you pay for Vista. Further more, Vista does not come “packed with software”, it comes with a few half-hearted attempts to take on the Linux distro market. If they were serious about providing a good package, Vista would include at least:

  • Microsoft Office
  • Microsoft ISS
  • .NET Studio
  • Microsoft SQL Server
  • Adobe Acrobat Reader

Over and above what it already has.

However in the distro world you have to rewrite lines of code to fix broken or at times missing links within open source components, I’m sure you could argue that this caveat makes Linux overpowering. However if you enjoy debugging software that should run at start, it sort of makes you rethink your place in the cosmos.

In 10+ years of running Linux software, I have yet to edit a line of code in the software I run. That excludes code I’ve written myself of course. On the other hand, if you’ve ever tried getting Oracle Application Server; MySQL; Apache; or WebSphere running under a Windows machine, you too will know the meaning of true frustration. I spent 2 weeks of my life trying to get WebSphere to work, and over a month resolving file-locking issues with a web system that worked flawlessly under Linux.

Lets talk about security, we no longer compare Vista and Linux because in the department they are at equal terms.

If you truly believe that: you are delusional. Sorry for getting a bit ranty, but this is complete rubbish. Linux takes a Unix approach to security, a system that was created decades ago, and has only evolved and improved over time. Vista throws out everything we’ve learned about security and puts the onus (in a technical, and legal sense) on the user. Linux secures everything on the file-system and network layers. Because all your inter-application communication goes through one of those two layers, it means you only have two points to gaurd (in a code sense). Vista expects an uninformed user to make impossible security decisions, or switch the security off.

Just like Linux, Windows also went through evolution. We can’t compare say windows 3.11 to VIsta, nor could we compare one distro to another.

I will agree that you can’t point out flaws in an older version of Windows and claim the same holds for Vista, but it doesn’t mean you can’t compare the two. Whats more, we can absolutely compare different Linux distributions, but then it comes down to what people want, and where their preferences lie.

However, what comes down to is stability, the fact you don’t here people complaining about issues on Linux does not mean there aren’t any that would implying its a perfect OS. But theres a problem with that analogy you see, nothing is perfect, Linux in all its glory suffers just as many flaws and holes in security when compared to something like xp.

I’m not by any measure implying that Linux is a perfect Operating System, nor even that such a system exists. I do feel strongly that it is the right choice for me, and for many of the people I live and work with. I feel limited by the lack of choice in a Windows system, and somehow I always feel that Windows systems think they know better than me. They provide convoluted, and annoying paths through config that often lead you to a dead end. Sometimes the options you change are thrown away on the next boot because some little “auto-detection” wizard or tool decides to run.

For lack of a better word it is called organization, something open source lacks otherwise we wouldn’t be seeing millions of distros.

The writer of this comment has obviously never worked for a large software company. The Open Source world may seem chaotic from the outside, but the hallmark of the really good projects (KDE, OpenOffice, Wine, etc.) is their excellent organization and structuring of the work and project itself. A software company on the other hand look organized on the outside, but is chaos on the inside.

I’ve seen deadlines and political pressure turn good ideas into steaming piles of software dung! Software that cost millions of dollars to develop. It winds up being re-written after a few years, because nobody can bare to maintain it anymore, and you know something: the process starts all over again.

What are DirectX and OpenGL?

Most people have no clue as to what DirectX or OpenGL actually is. Most people know DirectX as “the thing I need to run my games”. I felt it was time to write an explanation that clears up exactly what DirectX and OpenGL are. Below is a simple “stack” diagram to show how the layers between your Graphics Card (NVidia; ATI; Via; Intel; S3; etc.), and your Games fit together:

hw_stack.gifGoing from the bottom layer (your hardware), to the top layer (your Games): the first layer is the “Hardware Abstraction Layer”. This layer is provided by the Operating System (Windows, Linux or Mac OS), and allows Device Drivers to “talk” to the hardware by sending and receiving data and commands. It’s a bit like your web browser sending and receiving data to a web site on the internet.

However, each graphics chipset has a different protocol (think of it like a language) that it understands. Thats where the Device Driver layer comes in. The Operating System defines a set of standard language and set of commands that the Device Driver must provide to the Operating System. The Device Driver is responsible for translating those “Operating System Commands” into a the protocol that the actual Graphics Card can understand. A bit like a human translating between two languages.

However, generally a Graphics Device Driver for an Operating System generally has a very minimal set of commands for basic 2D operation (things like “draw this picture over here”; “draw a line here”; etc.), because there are still many graphics cards in the world that don’t support the complex operations expected by an advanced 3D Game. To compensate for that, DirectX and OpenGL provide an extended set of commands for doing complex 3D operations (like “draw a polygon”; “move the camera like this”; etc.). Why make the Graphics Hardware do this? Having Hardware perform an operation is almost always faster than having software do it, thus the term “3D Hardware Acceleration”. DirectX and OpenGL give software (like Games, a level editor, or a 3D modeling package) access to the more advanced features a Graphics Card may provide. You might think of them as an “Advanced Device Driver”.


  • What is the difference between OpenGL and DirectX?
  • What does “DirectX 7/8/9/10 Compatible mean”?
  • Why is there only “OpenGL 1 and 2”?
  • Why is there no such thing as an “OpenGL Compatibly” Graphics Card?

Well, I’ll be answering those questions in my next post.

Linux is ready for mainstream use, get over it!

Instead of hearing it less and less, I seem to be hearing it more: “Linux is to hard”, “Linux is not desktop friendly”. It’s probably all the talk of Vista, and all those trying it out and comparing their 10+ years of windows use to a week with Linux (sometimes no more than a half-baked attempt at installing a distro). Quite frankly guys, Linux is desktop ready. Not only my parents, but my parents-in-law and grand-parents run Linux. I know schools that have installed Linux, and their kids find Windows more difficult to work with. It’s a question of what you’re used to. If you don’t know that distro’s like Suse and Mandriva have wonderful hardware config tools, and you wind up re-compiling your kernel to install some weird wireless card that is supported through NdisWrapper, then shame on you.

I’m not of the opinion that Linux will one day be on every desktop on the planet. Nor am I the type that starts frothing at the mouth when they hear the word “Microsoft” (though I do know a few like that :P), what I’m saying here is simply: don’t dismiss Linux because you tried to install Ubuntu. Ubuntu is a heavily purest version of Linux (very VERY GPL based). Rather try something like Suse of Mandriva that includes things like you NVidia drivers and Flash.

Vista is a Linux Clone (Screenshots)

I’ve come to the conclusion that Vista is nothing more than a Linux clone. I run Gentoo linux along side Win XP on my desktop machine; and Suse 10.1 on my Lenovo laptop. After trawling through the many lists of features that Vista has, and playing with the Beta editions myself, almost all of it’s new “user” features are clones of features that have existed in Linux for months, and in most cases years! I find this rather funny, since people will be paying for features they could have for free. Linux costs nothing! Absolutely nothing! In my experience of using mostly Linux for over 7 years, it’s an all-round better system than Windows. To begin, many people will be familiar with tabbed browsing, thanks to Firefox or Opera. I find most of my tabbed browsing these days in when copying files between two folders in Konqueror (click the image for a larger version).
Multi-Tabbed Konqueror
After using Linux exclusively for more that 4 years, and having to go back to running Windows (for work reasons), the first thing I did after opening Windows Explorer was hit the ‘CTRL-SHIFT-N’ keys (the shortcut to open a new tab in Konqueror). As you can imagine, I was rather frustrated when nothing happened. It’s one of those things: when you’ve used something for to long, you get used to it.

One of the biggest features of Vista (besides Direct X 10, which I will get to later on) is the Aero interface, and how wonderful it looks. I’m running KDE 3.5 at the moment (looking forward to KDE 4), and one of the wonderful things about KDE is that you can completely change the way it looks. Suse, Kubuntu and all other KDE based Linux’s come with any number of “Styles” (the look of the buttons, text boxes and so on) and “Window Decorations” (the title-bar; minimize, maximize and close buttons; and border of each window) for you to choose from (my personal favorites are the “Plastik” style with the “Crystal” window-decoration).

This morning, I finally got around to enabling the Composite extension on my laptop (just been to busy with work to do that). This enables hardware-acceleration for your windows, lets you fade them in-and-out they grow shadows, etc. etc. etc. All the lovely things that people will be paying for in Vista. Another cute note: Crystal has the Vista as one of it’s options (click the image for a larger preview). So if you wanted your Linux machine to look like a Vista machine… No problem!Crystal Button Options

So Direct X 10… The “big” question. Linux doesn’t support Direct X directly (hehehe). Wine and Cedega do a surprisingly good job of it though (having run many games under normal Wine, and often at better frame-rates than my friends get under Windows). To my knowledge, the 3D drivers for Direct X 10 are still in their infancy, where the Open GL drivers for Linux from Nvidia, Intel and ATI are very fast, and very stable (though my old ATI drivers don’t cope so well with my 64bit machine). Open GL has one massive advantage over Direct X. Where new feature to Direct X require a new release, Open GL supports extensions. This means that graphics card manufacturers can develop simpler drivers, and simpler drivers means better performance, and more stability. Simple as that (note: I have developed software mode, Open GL and Direct X 7, and 9 applications).

Now for some fun tricks that Linux has up it’s sleeve. Suse 10.1 (and many other versions of Linux) come with Beagle out the box. Beagle does to your hard driver, what Google does with web pages. Indexes them, and lets you search them very very fast. On my machine I just need to press ‘F12’ or ‘ALT-SPACE’ to get Beagles friendly search window pop-open. From there, I type something of what I’m looking for, and in generally less than a second I’m looking at the results. What I was looking for is almost always within the first 5 results.

Splits and Tabs in Konqueror
Konqueror has both tabs, and split-windows, to give you an idea of what this allows, check out this image (click it for the big version). In case you havn’t figured it out by now, Konqueror is like windows explorer, or the “My Computer” icon in Windows. What you’re looking at here is my “Work” folder in one tab, and the tab you’re looking at is my “Images” folder, along side Google. Konqueror is also a Web Browser, FTP client, and many other wonderful things.

Now, in not one of the screen-shots I’ve given so far, can you see just how cool Linux can be when you add all these cool bits together. Bare in mind, all the software can be found on the Suse 10.1 DVD, no extra installing or downloading required. Also note the little square icons next to my custom made (took me about 3 minutes) “Launch” button, those 4 little boxes are four virtual screens. A bit like “Tabbed Screens” if you like.

I don’t aim to convert everyone with this blog entry, but I do hope to raise the awareness of just how far Linux has come since the days of a white-on-black console based system. Linux is a high speed, highly stable, user friendly and easy to use operating system, and I han’t even scratched the surface of the features it has. If you havn’t tried it in the past 6 months, go grab a copy of Kubuntu or Knoppix and try it out off the CD. You don’t even have to install it to try it out, just put in the CD and reboot, when you shutdown Linux, your computer will reboot in Windows again.

Full Screenshot Full Screenshot