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.

drive_commands.gif
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”.

But

  • 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.