Search Results: "ah"

13 November 2005

Antti-Juhani Kaijanaho: Programming is a cat-vacuuming activity

As I've mentioned before, I'm trying to write a 50K-word first draft of a novel during November. Writers, published and unpublished alike, tend to look for useful-esque procrastination activities, called cat-vacuuming because ... erm, if you vacuum your cat now, it won't shed later, or something. I did say useful-esque, did I not? By the way, the term originated in the Usenet newsgroup rec.arts.sf.composition, I think in the late 1990's. Honest. I was there, lurking. Anyway, for this Sunday afternoon, my cat-vacuuming took the form of programming in Haskell. Specifically, I wrote a sample answer to an exercise in the course I'm currently giving at the university. The exercise asked for drawing a particular fractal. I did that and found the result less aesthetically pleasing than I had thought when I drafted the exercise. So I fiddled with my program and ended up with this: An image of
a fractal Of course, the new program does not solve the exercise as specified, so I had to back out the change (I did leave a note about it in the comments). The program remains private until the exercise sessions next week.

Matthew Palmer: Working as a Witness

(A continuation of my reminiscences as an expert witness.) In an earlier post, I made brief mention of the unpleasant realities of being a witness in a trial. More details, ahoy! Most witnesses aren't allowed in the courtroom except when they're giving evidence (to avoid bias) and have to sit out in the hallway. Bring a fat book, because you could be out there for days. I don't think much compensation is provided for your time, either. And, as a final indignity, the lawyers might not even end up calling you to the stand. For example, one of the prosecution witnesses in the case I was involved with was called to appear, and sat outside the court for eight (count them, 8!) days, before being told he wasn't needed after all, and he could go home. I don't know about you, but if that had been me, I would have ended up in the dock myself on a charge of mayhem. Another witness, after having been through her time on the stand, made a comment along the lines of "I'm going to make sure I'm overseas next time". Expert witnesses (as I was) get treated a little better. We can watch most of the bantering in court, while we evaluate the technical evidence presented by other witnesses (experts and non-experts alike), and at least the pay is sensible. As an occupation, "expert witness" would be OK. The hours are pretty sweet, the pay is good, and the conditions quite reasonable. For a regular geek like myself, though, it was fairly close to agony by the end of it. I've had three big projects on indefinite hold while I was at court, unable to give my clients a firm date when I could resume work for them. They were all understanding, bless them, but I could have lost out badly. The complete uncertainty as to what is going to happen and when means that you basically end up camping out at the courthouse for umpteen days. At least, in my case, I was being paid regular consulting rates for my camping. When I say uncertainty, I really do mean it. I was originally told I'd be needed for a day or two -- a quick look at what the other witnesses were saying, maybe jump in the box for a bit, and then I'm off. Then the first witness in the stand was there for nearly three days (along with a day or two of procedural stuff in amongst it so I had been there a week before he was finished). Then the defence was going to make a motion for dismissal, because the prosecution were being pummeled by his honour for their lack of case preparation, so I would have been out of there. That never materialised. Then more procedural faffage, another witness that ended up in the box for about 4 days -- each day of which I thought was the last -- and then it was my turn, which lasted nearly four days. At no stage did I have any indication of when it was going to be over, either, so I couldn't say with any sort of certainty when I could start helping anyone else out. While the legal system has a vital part to play, I'm wondering if something could be done to improve the running of trials to reduce this sort of pummeling of witnesses. On the sweet hours: court convenes each morning at 10am. There's usually half and hour to an hour of transcription correction (although I get the impression that isn't a standard thing) then witnesses start going through. There's a half hour morning tea break around 11 or 11:30, and then an hour lunch at 1pm. Usually there will also be an afternoon break of 10 to 15 minutes, before court adjourns for the day at 4pm (if not a bit earlier). I presume that the reason for the short days is that it's mentally very tiring, and there's lots of prep work for the lawyers mornings and afternoons, but it's a lot better life when you've got none of that to do. Unfortunately, the day isn't short enough that I could get a lot of other work done, so it's effectively just a short-paid day.

12 November 2005

Ian Murdock: The thin(ish) client revolution

David Berlind: “[P]icture a world where, instead of carrying a notebook computer with you everywhere you go, and instead of having power-drinking desktops in every corner of your house, all you have is a USB key that you take from one dirt cheap thin client to another. On that key is not just all of your personal data (that is stored in the cloud but replicated to your USB key for offline usage), but perhaps a small Web server and some applications, both of which are thin-client friendly.” I’m in complete agreement that the thin client/web application computing model is the wave of the future, and that the days of the fat client as the primary mechanism for monetizing software are numbered. However, I don’t buy into the notion that software-as-a-service displaces the traditional fat client entirely, for one very simple reason: It’s going to be a while yet before we have truly ubiquitous network connectivity. Sure, perhaps if you live in the San Francisco Bay area or in a similarly technology centric place, it’s easy to buy into the notion that it won’t be long before we’ll all be connected all the time. However, we can’t lose sight of the fact that a vast majority of the population doesn’t live in a world where technology billboards dominate the morning commute. Heck, my cell phone doesn’t even work when I visit my grandfather in rural Indiana—the notion of an omnipresent wifi fabric built from community hotspots is a long way off there, to put it mildly. And even when we do get to the day when we have ubiquitous connectivity, we’ll still want caching for optimization and replication to eliminate the single point of failure problem, not to mention the ability to retain control over our own digital lives. So, I view the thin vs. fat client juxtaposition as being not so much about user experience—AJAX has shown us that remarkably good user interfaces can be built on the web. It’ll be more about caching and data replication, two very important considerations in any distributed system. I think most people are missing that. David, as usual, appears to get it. My prediction: Applications will increasingly move to the web, so you’ll be able to get to your data anytime, anywhere, and from any connected device. No surprise there. But the majority of the time, when you’re using “your” client device (whether it’s a PC in your home or office or a handheld device or something that lives on a USB key and securely attaches to the network via some device that’s outside of your administrative control), you’ll still primarily interact with the web through a fat client of some sort. To be sure, the fat clients of the future will look a lot different from the fat clients of today. Hint: “Fat client” doesn’t have to mean “self-administered”. Perhaps the fat clients of the future are delivered on demand or via independently developed components that integrate into some larger framework. Perhaps it’s as simple as running a web server locally. But the fat client in whatever form will still be the primary interface the vast majority of the time. That’s why I don’t buy for a minute that Web 2.0 is yet another death knell for Microsoft. They’ve obviously got a great fat client story, and in case you haven’t noticed, they’ve just woken up to what’s going on around them. By the way, this is the area where I think Linux on the desktop could have the biggest impact—it won’t be about who has the better desktop or who can replicate the popular fat client applications of today in open source. It’ll be about who can mold Linux into the fat client framework of the future, seamlessly integrated with applications and services delivered via the web but open. If I were Microsoft’s competitors in this space, namely Google and Yahoo, I’d be spending a lot of time thinking about this. In today’s fat client world, Microsoft is between them and their customers more often than not, and if the past is any indication, they’ll be able to use this position to tremendous advantage.

Jordi Mallach: Good Morning New York!

After a not-so-easy ride with James Blackwell, and the last minute surprise of Paul Sladen joining us, we arrived in New York. The sky was dark already. Instead of arriving at 15:00 or so as expected, we arrived at something like 20:00. Behind, we had left great perils like an empty gas tank and finding no gas station, and noticing one tire could use some pumping; evil officials at the US border not liking the fact that it was the first time I entered the country, which involved fingerprints and a smily face at the customs offices after a long wait; a great meal (after a long wait to get served) at probably the best restaurant in the whole State of New York; the three of us becoming terribly sleepy half an hour after resuming the drive, and having to stop for a short nap and stopping for gas once again around 70 miles away from NYC. When we did arrive, we managed to get lost a few times around the city. We crossed four bridges on our way to Brooklyn, which accidentally let me admire the Manhattan skyline by night, and finally, got to Clint's place. When we were parking, I noticed the tire was mostly flat now. Surely not the best way to land in the city. We also found out Clint and the rest had left for dinner after a long wait, as neither they or us expected to arrive so late, and we were way too freaked out with the crazy traffic and finding our way to phone them. After a while, both problems were sorted out; Clint appeared and James was able to leave. James, thanks for all you did! I owe you a big one next time! We spent some time with Clint, dilinger, biella and micah, saw the great view of Manhattan from the roof of his appartment, and eventually went to bed. Apparently, they are taking me to a place called "Dim Sum" for breakfast. I wonder how dilinger's cat tastes.

Antti-Juhani Kaijanaho: This sounds familiar

Cleaning my apartment is a bit like going on an archeological dig: A dried spaghetti noodle... when did I have spaghetti for dinner? Oh, yeah, three weeks ago.
(Tall Dark and Mysterious: See You in Ten Days)

Anand Kumria: A walk across the Sydney Harbour Bridge

# metadata <p> I woke, not for the first time today, and there were people all around. Dressed up and talking. And drinking. </p> <p> Ahh! I'd fallen asleep at a bar. <em>Again</em>. Fortunately that is enough off a clue for me to realise that I should go home. Getting home, is where this adventure starts. </p> <p> I started off at <a href="http://www.sydneypubguide.net/pubs/Cruise.aspx">Cruise Bar</a>, which has a great view of the Opera House [<a title="Sydney Opera House in the afternoon" href="/~wildfire/aum/images/opera-house-in-afternoon.jpg">1</a>], [<a title="Sydney Opera House at dusk" href="/~wildfire/aum/images/opera-house-at-dusk.jpg">2</a>], [<a title="Sydney Opera House at night" href="/~wildfire/aum/images/opera-house-at-night.jpg">3</a>] and (somehow) staggered my way to the <a href="http://www.sydneypubguide.net/pubs/Ship_Inn.aspx">Ship Inn</a>. Unable to flag down a cab in this area &ndash; lots of people going home around 23:00 &ndash; I resolved to get myself to North Sydney, where lots of cabs are. </p> <p> For those of you unaware, Sydney Harbour Bridge now has security personnel stationed at all pedestrian entrances and across its length. At least six of them "patrol" the bridge. </p> <p> By "patrol", I mean of course you'll be queried as to why you wish to cross the bridge. <q>Mate [sic], you can't cross the bridge. You aren't allowed here</q>. <q>Mate, are you fucking deaf?</q>. (on radio, to pals)<q>Yeah the fucking wog is crossing, shall I intercept him and hold him?</q> </p> <p> Followed while crossing the bridge. In my case I had (at one stage 3 security personnel behind and adjacent to me and 3 policemen ahead of me). And abused (I was repeatedly cursed at, racially slurred against, by the people from IVS Security) during your walk over the bridge. It amazes me that they even had police waiting to talk to me. Fortunately I know that the best thing you can do when confronted by the police is not to say anything. </p> <p> In this case there is nothing they could do -- since crossing the Harbour Bridge, and not responding to the security guards who harass you is not (yet) a crime. Today, 2 Nov 2005, though the Parliament of Australia is rushing through laws which might mean that I can be "detained" and held incommunicendo indefinitely. </p> <p> These laws &ndash; part of the War on Freedom &ndash; would make the rest of this entry illegal. </p> <p> I've been thinking about terrorism and Australia. How would you get access to restricted locations, determine sensitive areas and generally get information not available to the ordinary public? Become a security guard. </p> <p> In Australia, things like <a href="http://smh.com.au/news/national/braindamaged-man-told-to-pay-up-after-bashing/2005/11/01/1130823210703.html" title="victim of security guards">this</a> are not uncommon. (c.f. David Hooks killed by a security guard; a female security guard shooting someone, etc.). Worse is that security guards often enjoy a fairly close relationship with the Police. Meaning that if you join up, you also get to know some of the procedures that might be applied to deter you. Bottom line: every security guard is a potential terrorist. </p> <p> Terrorists, like modern-day Politicians, seek to curtail the liberty of others for their own purposes. The best way to do this is by planting fear and doubt into the hearts and mind of the general populace. In America, this was done via the September 11 plane hi-jacking; in the UK, by exploding bombs on the mass-transit system there. </p> <p> How, or where, should Australia be targetted? Australians are renowned world-travellers (I believe the figure is that 10% of Australians are outside the country at any one time), so attacking transportation isn't the way to go. You need to go after the life-style. </p> <p> Large community events, like Melbourne Cup day, the various Grand Finals and, of course, Cricket would be the perfect targets. High visibility (the media are already at these venues!), high impact (you are talking 30,000+ people in these stadiums), for minimal cost (a stadium has few seating area &ndash; probably 6 to 8 attackers could bring down most stadiums). </p> <p> Another good location would be to pick your local Westfield shopping centre / mall. Lots of people, lots of fear instilled. Plus we'd be rid of the stupid things. </p>

10 November 2005

Todd Troxell: Yahoo 2.0

looks like Zawodny has made the same conclusion about Google that I wrote about earlier. Re: moving in on existing markets rather than creating new ones. Like I said before, isn't that what they've always done?

Marc 'Zugschlus' Haber: Debian Linux Kernel Handboook

Jurij Smakov et al have published the Debian Linux Kernel Handbook, which will help in documenting the internals of the Debian Linux Kernel build process. The document is still work in progress with a lot of sections missing, but it's a giant step in the right direction.
Continue reading "Debian Linux Kernel Handboook"

Jose Carlos Garcia Sogo: Debian Sarge on the press

Yeah! Of course Sarge was released some time ago. How is it in the press now? A Spanish national newspaper, El Mundo is starting a software collection that is going to be given with printed newspaper. All of the included programs in the collection are for Windows OS, but with the first CD there is included a bonus DVD 9 with Debian Sarge in it. And these days they're advertising the software collection in radio and in the newspaper itself using the "Debian Linux 3.1" DVD as a major point in the collection. They are also going to distribute the ISO online after some time. Of course, I am going to get one.

Aigars Mahinovs: No that I have had time to consider my reactions, ...

No that I have had time to consider my reactions, I will write down, what was my experience in Dublin, when I went for a on-site interview for a job in Google. First of all, I had to sign an NDA before entering the office, so I can not tell you about anything that I learnt there. Still this is a huge post, to save me first impression, so that I can look back on it in the future (like tomorrow morning) and see how naive I was. :)

The first thing I noticed after arrival to Dublin was that the highway from the airport to the city was under repair. I was lucky though as I arrive at night and there was almost no traffic. The highway looked strange compared to highways in Belgium, Germany or UK - it had all those strange twists and turns and splits and merges - it looked like the highway was build adapting it into the space between other roads and buildings, like it was some kind of a country road. Oh and that driving on the left side - freaks me out every time.

After I arrived to the hotel and checked in, I discovered that executive suites of 3 star hotel look much like regular suites of five star hotels I've been accommodated earlier in my life. One more fun fact found me soon - the power plugs are all wrong :) When I was in UK some time ago, all homes that I went to used usual EU type plugs, so this was the first time I saw a UK plug in action. Needing power (a computer geek always needs power) I searched for a solution. I thought that I found one, when in the bathroom I found three round holes marked "for shavers only". I responded - "but this is an emergency" and tried to plug my notebook in anyway. Unfortunately they have thought about that - shaver plugs are thinner and just a tiny bit closer, so the regular power plug does not fit in shaver socket. Damn! Oh well, then I'll have to sleep.

Next morning I walked around the area of Google EU Headquarters scouting the surroundings. I found that the building, where the headquarters are, is still under construction - I am sure Google advised the builders on some minor adjustments ;). Just across the street there is a large block of residential houses. Small residential houses. I've seen apartments bigger then some of those houses. I also found several nice apartment houses: from the common "windows that Cappuletti will not climb trough" to modern housing with large windows and modern decor. I also saw the first backyard street in my life - a street less then half a meter wide between two lines of backyards. Diverse life. And that was only one neighbourhood - less then 5 minutes from Google office.

After the interviews were over, I planned to go to see the city center. Unfortunately looking on the map of the city did not provide any clue to discovering any such place. No central building, no central square, no central monument or park. Nothing - just a maze of streets. Well, I hit the maze. What I saw was a flood of people, just like in Riga on Friday night (it was Friday). The difference was that because of the lack of clear centre, the mass of people floated in a larger area. I noticed lots of very special shops that would have not survived in Riga (belt buckle shop?) and a general lack of big supermarkets that we are used to here. Also the people seam to be much more ignorant to traffic rules - it is easy to see people streaming across a street despite a red streetlight.

I can also touch a bit on food, as I tried the food in hotel and in a local fast-food place. Well, the situation in Ireland is much more positive towards fast-food. In Latvia the regular food is both much better and a bit cheaper then fast-food. In Ireland the quality level of regular food seams similar to the fast-food while the price of fast-food is lower. I rated the quality by the taste of meat, where perfect meat is from a wild animal shot in a forest and prepared straight without any additives, and worst meat is slice of fast-food hamburger meat with all the salt and additives they put there. Of course I couldn't get a clear sample within my short stay, but I tried to be as objective as I could.

The conclusion? In my mind, moving from Riga to Dublin will be a downgrade in life quality. Google's offer must be good enough to compensate this, if they want me in. We'll see soon enough. I should have the answer before next week.

P.S. The level of spam in my mail has reached 11 000 per month. Yay! :P

Aigars Mahinovs: Now that I have had time to consider my reactions,...

Now that I have had time to consider my reactions, I will write down, what was my experience in Dublin, when I went for a on-site interview for a job in Google. First of all, I had to sign an NDA before entering the office, so I can not tell you about anything that I learnt there. Still this is a huge post, to save my first impression, so that I can look back on it in the future (like tomorrow morning) and see how naive I was. :)

The first thing I noticed after arrival to Dublin was that the highway from the airport to the city was under repair. I was lucky though as I arrive at night and there was almost no traffic. The highway looked strange compared to highways in Belgium, Germany or UK - it had all those strange twists and turns and splits and merges - it looked like the highway was build adapting it into the space between other roads and buildings, like it was some kind of a country road. Oh and that driving on the left side - freaks me out every time.

After I arrived to the hotel and checked in, I discovered that executive suites of 3 star hotel look much like regular suites of five star hotels I've been accommodated earlier in my life. One more fun fact found me soon - the power plugs are all wrong :) When I was in UK some time ago, all homes that I went to used usual EU type plugs, so this was the first time I saw a UK plug in action. Needing power (a computer geek always needs power) I searched for a solution. I thought that I found one, when in the bathroom I found three round holes marked "for shavers only". I responded - "but this is an emergency" and tried to plug my notebook in anyway. Unfortunately they have thought about that - shaver plugs are thinner and just a tiny bit closer, so the regular power plug does not fit in shaver socket. Damn! Oh well, then I'll have to sleep.

Next morning I walked around the area of Google EU Headquarters scouting the surroundings. I found that the building, where the headquarters are, is still under construction - I am sure Google advised the builders on some minor adjustments ;). Just across the street there is a large block of residential houses. Small residential houses. I've seen apartments bigger then some of those houses. I also found several nice apartment houses: from the common "windows that Cappuletti will not climb trough" to modern housing with large windows and modern decor. I also saw the first backyard street in my life - a street less then half a meter wide between two lines of backyards. Diverse life. And that was only one neighbourhood - less then 5 minutes from Google office.

After the interviews were over, I planned to go to see the city center. Unfortunately looking on the map of the city did not provide any clue to discovering any such place. No central building, no central square, no central monument or park. Nothing - just a maze of streets. Well, I hit the maze. What I saw was a flood of people, just like in Riga on Friday night (it was Friday). The difference was that because of the lack of clear centre, the mass of people floated in a larger area. I noticed lots of very special shops that would have not survived in Riga (belt buckle shop?) and a general lack of big supermarkets that we are used to here. Also the people seam to be much more ignorant to traffic rules - it is easy to see people streaming across a street despite a red streetlight.

I can also touch a bit on food, as I tried the food in hotel and in a local fast-food place. Well, the situation in Ireland is much more positive towards fast-food. In Latvia the regular food is both much better and a bit cheaper then fast-food. In Ireland the quality level of regular food seams similar to the fast-food while the price of fast-food is lower. I rated the quality by the taste of meat, where perfect meat is from a wild animal shot in a forest and prepared straight without any additives, and worst meat is slice of fast-food hamburger meat with all the salt and additives they put there. Of course I couldn't get a clear sample within my short stay, but I tried to be as objective as I could.

The conclusion? In my mind, moving from Riga to Dublin will be a downgrade in life quality. Google's offer must be good enough to compensate this, if they want me in. We'll see soon enough. I should have the answer before next week.

P.S. The level of spam in my mail has reached 11 000 per month. Yay! :P

9 November 2005

Aigars Mahinovs: Now I am getting a bit photoestatique - my Canon E...

Now I am getting a bit photoestatique - my Canon EF 100-300mm f/4.5-5.6 USM lens has already arrived and my Canon Digital Rebel XT (350D) with the kit lens and a 1 Gb Compact Flash card has shipped from USA today. When it arrives, I will go to a local shop and buy myself a Canon 50mm f/1.8 prime lens. With that my new photographic kit will be complete. Finally!
Now, I must reserve next weekend to image hunting activities...

Antti-Juhani Kaijanaho: W00T! 10.000 words!

I've reached the one-fifth mark in my quest to write a novel in a month. I'm five thoudand words behind of the linear pace, though. NaNoWriMo 2005 Participant

8 November 2005

Mike Hommey: Bones scattered all about

I’m not sure I have to be proud of the fact that my name has a meaning in klingon.

7 November 2005

Antti-Juhani Kaijanaho: Klingon Hommey

As I wrote earlier, I am trying to learn the Klingon language. Today, I caught up on Planet Debian postings and saw one of my fellow developer's name in a completely new light: Hommey is interpretable as Klingon. Hom means 'a bone', and -mey is the general pluralizer. Normally Hom would be pluralized by -Du', because it's a body part, but when -mey is used, it implies that the bones are used not as parts of a body but in some other usage (as weapons or something like that). In a poetic context, Hommey can also mean bones scattered all about.

Adam Rosi-Kessel: Boston City Council 2005 Endorsements

Hey, no one asked me, but here are my endorsements for tomorrow’s city council election: In any case, if you’re a Boston voter, be sure to participate tomorrow, whomever you choose to support.

Andrew Pollock: [debian] Ouch

Greg Kroah-Hartman did say:
If you have a problem with the way Debian handles udev, I'll point you to the proper place to complain about that. Debian is slowly sinking into the muck and it's fun watching it happen.
That hurts.

6 November 2005

Matthew Palmer: Cleaning The Barbeque

Hi everyone, my name's Matt and I'm a BBQaholic. Seriously, I love to cook on the barbie. It's outdoors, you get the best smells coming off the searing meat and vegetables, and you can quietly put away a cold beer in the name of culinary exploration. So, during a visit to the hardware store today, I was suitably interested when I saw a product called "BBQ cleaner". Curious as to what might be so fantastic as to advertise itself as a cleaning product specifically and exclusively for use on my favourite cooking utensil, I took a look at the back. The first item on the "How To Use" instructions:
  1. Put on rubber gloves.
And there I stopped. Anything that requires rubber gloves to the point of adding an item in the usage instructions specifically to that end (rather than, say, a general blurb saying "wear adequate eye and hand protection whilst using this product" which is standard on everything down to and including toilet paper) is *not* going anywhere near a food preparation surface in my household, Thank You Very Much.

5 November 2005

Anthony Towns: Britney's Memory Management

One of the things about the whole money thing and free software is the question of whether it’ll take all the fun and spontaneity out of hax0ring. As it turns out, that doesn’t even work when you try; so instead of doing dak work last weekend, like I’d planned and like the market was indicating, I ended up hacking on britney until about 5am Sunday morning, leaving the dak stuff to be spread over the week, instead. (After the last post, dak might seem cursed, but trust me it’s not. More on that RSN, but not just yet) For those playing along at home, britney is the name of the scripts used to update Debian’s testing distribution; basically it automates some of the hard problems of Debian release management. Naturally, this is a pretty tricky job – there’re over 200,000 packages in Debian unstable (spread across eleven architectures), with fairly complicated sets of interdependencies amongst them. It gets complicated enough, in fact, that the core analysis britney undertakes isn’t just too processor intensive to do in perl or python, it’s too memory intensive to use standard malloc for its data structures. (Cynical and Coding, and the UQ CS228 class of ‘98 will probably have some idea of the fun to come at this point…) The problem is that britney uses an absurd number of linked lists to resolve dependency issues, with each entry in the list being an independent block of a dozen or so bytes; and adding the usual malloc overhead to this can effectively double the memory usage. Worse, britney also likes to reuse memory quite a lot, does a fair bit of backtracking, and generally acts like the prima donna she is. Up until last week, britney’s memory was managed by the use of a parallel bitfield indicating whether memory was free or not: so britney would first allocate a 128kB block using standard malloc, note it’s all free, then every request for 12 or 52 bytes would result in some bits being twiddled; and every free would twiddle the bits back, so they could be reused later. This means two things: one is that the free invocation has to include the size of the memory to be freed as well as the address, and the other is that finding an appropriate sized block of freed memory can be awkward, leading to some degree of fragmentation. This fragmentation seemed to lead to britney having a gradual memory leak, which would mean that if the release managers were doing some complicated transitions gigabytes of memory would end up being used and OOMing; or, since britney runs on ftp-master and it’s probably not a good idea to have the OOM killer start on the machine that ensures the Debian archive’s integrity, the ulimit is reached, and britney aborts unhappily. Unfortunately, though, the use of a “roll your own” malloc means you can’t use the standard memory checkers to see what’s going on, so you’re left with guessing and hoping. And as a consequence the memory leak’s been around for ages, causing fairly regular minor annoyance. This changed last week when Micha Nelissen (neli) got into the act:
<neli> why does it need so much memory ?
<aba> neli: because it needs to check how the changes affect the installability count
<neli> aba: ok…but still does not seem like a big deal
<neli> how large trees are we talking then?
<aj> it has to do a lot of backtracking
<aj> how large is the longest dependency tree in debian?
<neli> backtracking only takes time, not space, right?
<aj> you need a list of things to backtrack over
<aba> neli: it also consumes memory, at least with the current dpkg-implem ntation
<aba> (well, there are ideas how to avoid this memory fragmentation, but that’s something else)
<aj> (it’s not actually memory usage, it’s memory fragmentation)
<neli> hmm, bad memory manager ?
<aj> imperfect, *shrug*
After poking around at getting britney to run locally, and doing some basic analysis on how it was used, neli decided to rewrite the memory manager to use chunk-size pools – so that a separate pool would be used for 4 byte allocations, for 8 byte allocations, for 12 byte allocations, etc. That’s possible due to two factors: one is that the special memory allocation is only needed for data structures which are all made from fairly small sizes, and are a multiple of the word size. It also means that fragmentation can be avoided completely – since you can use the “free” elements to store a free list taking up no extra space. Happily, that change also made the memory allocation much simpler. (It also shows the benefits of a fresh look at code; I’d been thinking of doing something similar for ages, but always been stopped because I couldn’t figure how to make it cope with the various different sized blocks I’d need. As it turned out though, I’d solved that problem ages ago when I wrote a separate allocator to deal with strings, which would’ve required my malloc to cope with a much larger variety of sizes) What it didn’t do was actually solve the memory leak. Which was pretty confusing, since the old memory checker had some tests to ensure that memory wasn’t really being leaked, and if the memory’s not being lost due to a missing free, or being lost to fragmentation, where is it going? At this point, the real benefit of having a simpler malloc implementation came across; because suddenly it was plausible to add some debugging code to allocate a separate pool for every memory allocation, and to report how much memory is being used at any point, per line of code. That gave me output like:
pool 8B/1:751; 1962683 used 1965960 allocated (99.8% of 22 MiB)
So I knew that line 751 (of dpkg.c), was allocating 8B chunks, had used up to 22MiB in the past, and was currently using 99.8% of that. (Actually, I made an off by one error initially, so the “8B” above is actually 12B, as you can see if you divide 22MiB by 1965960) That let me see two “leaks”. One turned out to be fairly easy to diagnose; as an optimisation, when I say “package foo is installable”, I note that “but we used bar to see that, so if we later update/remove bar, note that we’ll have to see if foo is still installable”. So the datastructure for bar ends up with a linked list of all the packages, foo, that relied on it. But I don’t check that list for dupes, so if I note that both bar and baz were required for foo to be installable, then update bar, when I recheck foo, I’ll add it to both bar’s and baz’s lists; which is fine for bar, whose list I cleared when I updated it; but not so fine for baz, because it’s now got two entries for foo. Having already added a check for dupes when trying to see if my guess was right, extending that check to skip the addition was pretty easy. The other leak required a little more investigation. It was in a fairly tight loop which could reasonably be using a fair amount of memory; but by the end of the loop it should all be freed. Adding some more debug code to the allocation functions confirmed the problem:
<aj> pool 8B/11:1231; 1618157 used 1703936 allocated (95.0% of 13 MiB, 9.05% current)
<aj> so it looks like ~9% of those allocations are never freed to me
<aj> 9.05% = used/alloc
<aj> where used is incrememnted on b_m, decremented on b_f
<aj> alloc is incrememneted on b_m, never decremented
The code was meant to either add the allocated block to a larger list that’s being traversed, or to free it immediately – the problem turned out to be that there were some nested ifs, and an internal if was lacking an else that should have freed the block. Fixing that changed the results to:
pool 8B/11:1228; 160 used 131072 allocated (0.1% of 1 MiB, 0.01% current)
Which both dropped the leak – only allocating a maximum of 130,000 nodes instead of almost 2,000,000 – and resulted in almost all the allocations that had ever been made, having been freed once britney had been running for even a fairly short while. As it turned out, though, the cure for the first leak was worse than the disease – checking for duplicates in a linked list turned out to take too long, and the memory wasted in that section wasn’t that big a deal. Using a red-black tree or similar instead would’ve been a solution, but so far doesn’t seem necessary. There haven’t been any OOMs since, happily; and even better, the reduced bloat seems to have made the overall checking a bit faster. Sweet.

James Morrison: Jehovah Witnesses

I've figured out why the Jehovah Witnesses never come to my door. I am never home.

Next.

Previous.