Josef “Jeff” Sipek

April 13, 2010

mail_conf_suck

Filed under: programming open-source — JeffPC @ 18:52

I was just looking at the source for Postfix, when I came across this function:

/* mail_conf_read - read global configuration file */

void    mail_conf_read(void)
{
    mail_conf_suck();
    mail_params_init();
}

It turns out that mail_conf_suck reads in the config file, and then mail_params_init does all the dirty work of initializing the internal data structures based on the config.

Anyway, that's the random thought of the day. I found it marginally amusing.

Edit: the code in question is in src/global/mail_conf.c.

November 10, 2009

Firefox

Filed under: open-source rants — JeffPC @ 02:24

Dear Firefox,

You Suck.

Sincerely,

Josef 'Jeff' Sipek.

P.S. xulrunner-stub using 4% CPU when the window is not visible and 36% when re-rendering parts of the page is a bit too excessive.

October 22, 2009

Linus & Windows 7

Filed under: open-source random — JeffPC @ 21:20

You might have already seen this image, but in case you haven't...

Linus + Windows 7

Microsoft tried to torpedo the success of the Japan Linux Symposium by launching their Windows 7 product that same day. They even had setup a big promotion booth across the street from the conference center.

During a break, we decided to make some fun of Microsoft and dragged Linus over there. When we arrived there, Linus was sold immediately on the product as you can see in the picture. At least that's what the sales guy thought. He obviously had no idea who he was dealing with. But in the end Linus surprisingly did not buy a copy. Wise man!

October 1, 2009

TurboHercules

Filed under: legal open-source programming/mainframes — JeffPC @ 21:55

Few days ago, a new company was created: TurboHercules.

As the name implies, they package up Hercules (an IBM mainframe emulator), and provide support for it. They are targetting the platform as a disaster recovery solution.

It shouldn't directly affect the open source project in a negative way (just like Red Hat cannot prevent people from continuing their work on the Linux Kernel). At the same time, it'll change the way people look at Hercules.

September 13, 2009

Think!

Filed under: open-source programming programming/kernel rants sysadmin — JeffPC @ 22:02

Alright, it ain't rocket science. When you are trying to decide which filesystem to use, and you see a 7 year old article which talks about people having problems with the fs on Red Hat 7.x (running 2.4.18 kernels), are you going to assume that nothing changed? What if all the developers tell you that things changed? Are you still going to believe the slashdot article? Grrr... No one is forcing you to use this filesystem, so if you believe a 7-year old /. article, then go away and don't waste the developers' & others' time.

May 7, 2009

RHEL 5.4: Now shipping XFS

Filed under: miscellaneous open-source — JeffPC @ 18:04

Wow, it's about time!

Sources tell me that RHEL 5.4 comes with XFS support. This is good news for all those folks wanting to use filesystems larger than 16TB and not trusting ext4 with their data (I couldn't blame them). As far as I know, these unfortunate souls have been told to use GFS2 if they wanted a RH supported fs that did more than 16TB. (It's worth mentioning that ext3 had a 8TB limit until about two years ago, when it got fixed up to support whopping 16TB.)

April 11, 2009

ditaa

Filed under: open-source — JeffPC @ 18:01

Wow. Just wow.

One of the dudes on IRC pasted a link to ditaa. Ditta is a utility that converts ascii art diagrams into bitmap files. See their website for examples.

It would be even more amusing if it spit out some vector format --- eps would be just fine.

April 9, 2009

Fedora 10

Filed under: rants open-source — JeffPC @ 23:12

Recently, I was tasked to install Fedora 10 on 2 systems. I have to say, it's a major pain. Here are my observations.

Live CD

The Fedora CD I got my hands on was a live-cd with an icon allowing you to install it to a disk. Neat idea (I first saw it few years ago with Ubuntu; they used Unionfs with tmpfs) of using dm-zero (IIRC) to provide a virtual disk with stuff. The downside is...it takes ages to get into the installer.

Partition editor crash

I've experienced a crash of the installer when I was setting up the partition table. It was pretty annoying, but at least I just had to start the installer again and not reboot. (I didn't bother saving the trace, but it was related to NoneType lacking isEncrypted attribute.)

NetworkManager

This is just plain ugly. Why do I want NetworkManager running on a server? Grr!

No choices

And worst of all...there were no choices to make during the installation process. So crap like X11 and Gnome got installed...I don't need either on a server system.

Are Linux distros really turning into steaming piles of bloatware? I hope not!

August 2, 2008

Wordpress sucks, archive.org rocks

Filed under: rants open-source sysadmin — JeffPC @ 16:32

This is a follow up post to Wordpress sucks from a week ago.

I decided to try to figure out some more category names, and then it hit me...my site is crawled from time to time by The Wayback Machine. So, I searched, and found a copy from November 2007. Not the latest, but quite new enough to have all the categories I had. A little while later, my blahg is back to its former glory. And there was much rejoicing.

April 19, 2008

Memory Leaks

Filed under: programming programming/kernel rants open-source — JeffPC @ 18:23

Alright, I think I've had just about enough. Why does Amarok eat up 22% of my RAM (1GB) after 4 days of running (and playing music for maybe 18 hours of those 4 days)? Why does Firefox use up 33% of my RAM in 4 days?

Why is it that when I shut down the app, and restart it, the usage is 4-5 times less?

















  Amarok Firefox 2
before app restart 225 MB 338 MB
after app restart 58 MB 72 MB

The only reason I can think of is application being buggy, or having really crappy defaults.

Buggy Applications


Dear developers, believe it or not, when you allocate memory, you also have to free it when you are done with it. If you don't, you are committing a crime against humanity known as a "memory leak". This memory is unusable, and essentially becomes dead weight the process carries around. Since it is not used, the OS may swap it out, and before long, your swap file/partition becomes full of memory that has been leaked.

Contrary to popular belief, freeing memory is really simple.

For you C++ coders (yes, that includes you Amarok folks), you simply use the delete keyword followed by a pointer of what you want to free. For example,


delete some_pointer;

If you are using C, the free function is your friend. Just call it, and make the one argument you give it the pointer to what you want to free. For example,


free(some_pointer);

Now, if you are working on a larger project, there might be wrappers around the memory management (malloc/free, new/delete) functions, but whatever the "free this memory" function is called, USE IT.

I can almost hear all the managed languages fans yell: "Just use a language that does garbage collection, and you won't have to worry about freeing memory." Well, you are WRONG!

Garbage collectors maintain graphs of memory allocations, and whenever they notice that some piece of memory is unreachable, they mark it as garbage, and free it. Here's my favorite example for causing leaks in a garbage collected language:

Suppose that you have implemented a class that works as a stack. You implemented it as a list of elements, and an index into the array to mark the top of the stack. Pushing an element is trivial, you just increment the index, and set the reference in the array to the object you want to store. Popping is really easy, you just decrement the index, and you're done. Right? WRONG! Decrementing the index changes that one integer variable, but that reference in the array is still valid, and therefore the object is still reachable as far as the garbage collector is concerned. Sure, next time you push into that slot, the previous reference will get broken, and the previous allocation will get freed (assuming that there are no other references). But what if you never push that many elements back onto the stack? What if you experienced some high-load spike? You'll have a large number of objects incorrectly referenced, tieing up memory, and quite possibly making the entire system slower.

How can you solve this? Pretty simple, just reset the reference to some "null" quantity. In Java, that means using the null literal. For example,


some_reference = null;

In Python, None is the proper keyword to use:


some_reference = None

The lesson is, free the memory you allocated when you are done using it.

Crappy Defaults


Many large applications (Firefox included), have many options you can set that affect its behavior. The default options should cover 95% or more of the users (or at least the greatest majority possible). Why such a high number? Well, suppose you settle for making 90% of your users happy out of the box...that means that 1 in 10 people that try your app will not be happy with the defaults. How many will bother checking if there even are knobs they can turn to make it work the way they want? Not all. Some will just try to install another open source app written by someone else that does pretty much the same thing. So, the default options should make as many people happy as possible.

How does this tie into a third of my RAM being used by Firefox? Simple, I do not know if there are any knobs that would "fix" the problem I am seeing. For all I know, someone decided that it was a great idea to be really aggressive about caching web page content in memory - something that's fine if you have 16GB RAM, but guess what most people don't.

Whatever it is (defaults that don't make sense or memory leaks), Firefox and Amarok have problems that must get addressed. What is one of the reasons people complain about Microsoft Word? It takes up tons of memory. Well, I don't feel like throwing over 200 MB of RAM at an application that plays MP3s, displays a playlist, and cover art.

And before someone suggests that I use Firefox 3... I realize that it is all super-duper-better-than-ever, but let's think for a second. When the original Firefox was released, it was hailed as the non-leaky, light-weight Mozilla. Then, things started to get slow again. Firefox 2 was supposed to be the super-fast, non-leaky browser. What happened? What happened to my >300 MB of RAM? Now, Firefox 3 is all the rage...do you see the pattern yet?

I think this brings up a larger issue. It's no secret that I do some Linux kernel coding from time to time. In the kernel, there are leaks at times, but it seems that the kernel leaks are effectively non-existent compared to applications like Firefox. Don't believe me? How come you can have a server run for over a year and it responds just as well after the year as it did when you booted it? Imagine running Firefox for a year without restarting it? Can you even imagine that? The Linux kernel doesn't seem to be the only "non-leaky" (there are leaks, but they are very rare, and probably mostly in the ugliest parts of the kernel - device drivers), Apache performs quite well even after running for a while, PostgreSQL, and the list goes on and on.

Why is it that Firefox and other projects seem to have so many problems? The only thing I can think of is the quality control that goes into checking new code before it's committed. In the kernel community, a patch may get rewritten a dozen times, submitted to mailing lists for review, get comments from people familiar with the subsystem, but also from other developers (and budding developers trying to understand the existing code). It takes a lot of effort to get a piece of code into the kernel, but in the end, that code is well written, well reviewed, and it should benefit most users. Do the Firefox, et. al., communities do this? I do not know, but somehow, I suspect that it isn't the case.

Powered by a pile of c