1.1 Memory Update

By Matt Matt Permalink

In the past, the ‘Bird has been known to eat more than its fair share of memory. Many people asked us to put Songbird on a tighter diet, and this was a big part of our focus for the 1.1 release.

Fortunately, Mozilla spent the last few years working on the same problems, and created some great tools and tutorials to get us started.

For example, this is a treemap we generated using a TraceMalloc snapshot and the JavaScript Information Visualization Toolkit, showing a simplified view of who allocated what:

treemap

Initially this view was just depressing. It looked like our only hope was to get rid of the XBL bindings, JavaScript, CSS, database engine and everything else that makes Songbird cool. Eventually, after many hours exploring memory allocation logs, we found areas that could be easily improved.

Here are some results:

memory

Details: For this comparison we used a Windows XP SP2 machine with 1GB of RAM, and a library of 20,000 mp3s. By “Add-ons or Helpers” we mean the default add-ons for Songbird, the Winamp taskbar agent, iTunesHelper.exe, and WMP’s Media Guide.

And the winner is… Windows Media Player? Unexpected.

The point is we managed to reduce basic memory use with a large library by about 40%. Even more important, Songbird will no longer take all your RAM if you leave it playing for a week.

Specifically, we:

  • Cut CPU usage during playback by half
  • Fixed some serious playback memory leaks
  • Drastically restricted database caching
  • Tuned the media item property cache
  • Added batching to the media importer, reducing memory use by 60%
  • Reduced Mac download size 45% by stripping debug symbols (oops)
  • Fixed minor memory leaks when switching feathers
  • Extended our performance monitoring farm to track memory usage and prevent regressions

There is still a lot to do though, and we’ll continue to focus on memory and performance in the future. The iTunes importer, add-ons like mashTape, or lots of browser tabs significantly increase memory usage, and deleting a lot of tracks at once still takes a long, long time.

If you haven’t yet, please grab the latest 1.1 beta and give it a try. Let us know what is working, and what is still painful.

Both comments and trackbacks are currently closed.

6 Trackbacks

  1. [...] Enlace a la noticia, así como al llamamiento para los probadores de esta versión. (ing) [...]

  2. [...] on long playbacks by half! but that doesnt mean it is the fastest, on thier own blog, they posted a comparison between: Songbird, winamp, itunes and WMP, you would be surprised to know WMP had the lowest memory [...]

  3. [...] made some substantial gains this [...]

  4. [...] เช่น ลดการใช้หน่วยความจำ (ดูเพิ่มเติม), [...]

  5. [...] เช่น ลดการใช้หน่วยความจำ (ดูเพิ่มเติม), [...]

  6. By Música para os ouvidos (parte III) « Mar 30, 2009 11:39 am

    [...] há nada nele  que o songbird (software livre com código aberto) não faça melhor usando menos memória. A Microsoft é um verdadeiro lixo, desde o começo de sua empreitada na internet, criando o [...]

29 Comments

Subscribe
  1. NickM Mar 2, 2009 9:37 pm Permalink

    I always wondered why the Mac version was so much bigger than the Windows version ..

  2. Moshy Mar 2, 2009 10:20 pm Permalink

    I don’t think WMP being the lowest is that unexpected, you tested it on XP so it has the homeground advantage.

  3. Ferdinand Mar 2, 2009 11:11 pm Permalink

    WMP probably uses a lot of stuff that’s already loaded like the GUI toolkit and Explorer.

  4. aus Mar 2, 2009 11:19 pm Permalink

    @Moshy

    Well, the same could be said about Winamp which is a native Windows application that is only for Windows. I think your argument is a little weak there :)

  5. Pino Mar 2, 2009 11:20 pm Permalink

    Great work. Now that I have a monster computer there is not so much need any longer, but on my previous computer Songbird was quite big. A lot of people seem to want their media player to be small, so this is a good change.

    While maybe not meant to be, that graph is quite deceptive. At first look Songbird 1.1 seems to be ahead of iTunes and Winamp already, but then you find there to be an almost invisible bar which indicated addons that are installed by default. Still it is a great archievement

  6. Bhima Mar 3, 2009 12:41 am Permalink

    Serious Question: Currently I use iTunes on a Mac Pro dual quad with 16 GB of RAM. As my Library has expanded (50,000 music tracks & 6,000 audio-book tracks) iTunes has become noticeably slower. How would Songbird deal with a large media library and is there a way to allow songbird to use more RAM and hopefully become faster in dealing with large libraries?

  7. Klint Mar 3, 2009 12:49 am Permalink

    @Bhima: you will be able to try it by yourself in a few days with the release of SB 1.1 . You can install it, test it, let us know the results (!), and remove it it you are not satisfied :)
    It will leave no footprint.

  8. atreiu Mar 3, 2009 1:40 am Permalink

    Good job, songbird team :)
    I didn’t mind the Memory Usage, but its great anyway ;)
    But I love the better CPU usage.

    I hope you will take a look at the startup-time, too, in the future.

  9. yew Mar 3, 2009 2:24 am Permalink

    the improvement in memory consumption is tangible! while building my feather, i had to refresh UI allthe time, and songbird was always open, and there were times it consumed up to 300mb, higher than the photoshop with 3 files with many layers. i built “euphoria” on 1.0 to avoid any bugs, and now that i grabbed the second 1.1 beta, its running smooth, i never saw it take more than 110mb =) and that was while ipod sync.

    great work! can’t wait for the final release!

  10. jb Mar 3, 2009 3:28 am Permalink

    Wow.. You guys are serious, and i like really like it.

    If You keep working in the same speed as you have done upon til now… We will see Songbird take over the desktops real soon.. I sure think and hope so :)

    Happy hacking :)

  11. Andrew Mar 3, 2009 3:46 am Permalink

    What about adding Windows media centre to the benchmarks too?

    For me, its great that memory usage is decreasing (and I’d imagine that as soon as Songbird is shifted to the Mozilla 3.1 platform, that it should be much better as 3.1 supports JIT for Javascript and the XUL interface).

    I have 4GB of ram though, so I don’t care if Songbird consumes 2GB for cache, as long as it starts quicker..

    I can barely remember Songbird 1.0 days actually now :P Songbird 1.1 is finally really usable :D

  12. Andrew Mar 3, 2009 4:14 am Permalink

    Also, forgot to mention, the crashes in Songbird 1.1 are a lot nicer too..

    In 1.0 when you changed the shared sound format in vista, songbird went mental and started eating all system ram (and swap), eventually making the system feel totally frozen.

    In 1.1 a whole heap of stuff was rewritten, and a side effect was that now only songbird freezes up, and eats up 1 CPU core (so the system is still totally usable). So obviously the changes brought about much better and safer code, even during crashes..

    Btw, this bug affects every vista program, but programs respond in different ways. Generally they crash completely, or simply lose the sound channel (I’m not sure it can be fixed completely in vista, as even Microsoft’s applications lose sound completely).

  13. katana346 Mar 3, 2009 6:49 am Permalink

    This is excellent! That was perhaps Songbirds biggest shortcoming, and alot of people I tried to show SB to looked at the memory usage and said “No Thanks”. I can’t wait for the final 1.1 release.

    On another note, I’m not really surprised WMP was the lowest… for all the S#$% it gets its not THAT awful of a program for basic video and music usage. It’s got nothing on SB though in terms of innovation and flexibility. Wonder how 12 will rank, if they improved anything performance-wise.

  14. Anonymous Mar 3, 2009 10:18 am Permalink

    Much like Internet Explorer, Windows Media Player effectively “cheats” by using OS services that most other programs either don’t or can’t use, putting some of its resource usage out-of-process. For comparison, imagine looking at Rhythmbox or Quod Libet and then ignoring GStreamer or PulseAudio.

    You might consider doing your comparison by booting a system, getting a baseline value for total RAM used, running the player in question, and getting the new value for total RAM used, ignoring the per-process values. I think that would give you a fairer comparison.

  15. KN Mar 3, 2009 11:10 am Permalink

    You should take a look at XMPlay
    http://xmplay.com/

    While it doesn’t have any video support it is vastly superior when it comes to memory usage and performance :)
    It also have some nice extra features that are accessible by middle- and right-clicking on some buttons.

  16. Ulath Mar 3, 2009 5:27 pm Permalink

    For just an audio player, you cant go past aimp (http://www.aimp.ru/index.php?do=download-player)

  17. Alfred Kayser Mar 4, 2009 1:53 am Permalink

    Note, during development of my themes/feathers for Songbird (Walnut/Walnut2) I noticed that the XUL for the SB windows is done very inefficient. Generally UI performance benefits a lot from simplifying XUL.

  18. mr1134 Mar 4, 2009 4:45 am Permalink

    Well, I don’t know what u’ve been measuring, but my winamp uses around 9MB during Playback (Library opened, Win XP Sp2). To be fair: I disabled video-support and the taskbar-agent, as well as several other plugins, i never ever use. And its lib is so much faster compared to the Songbird-Lib.

    - Winamp Modern Skin
    - Lib of 40000+ songs
    - Last.fm Plugin
    - Lyrics Plugin (opened)

  19. tim Mar 4, 2009 9:56 am Permalink

    Hey guys. I love songbird. But I’ve been having a little issue lately with it.
    I recently hit 4,000 songs in the collection, with most of the album art i could get.
    I have converted/adapted some plugins I wanted to work with the newest nightly build (1.1.1b2 i think it was), but I was having no problems until just last night.
    I’m running Ubuntu 8.10 Intrepid, and It just doesnt seem to open for me. So I tried to run it in the Terminal and Got this:
    http://i43.tinypic.com/2cqgqv8.png

    Something else pops up that might be more conclusive, but it pops up at the beginning of all that, and the terminal isn’t letting me scroll up there.

    thanks guys for the app, and for the help.

  20. tim Mar 4, 2009 10:02 am Permalink

    I’ve also tried downloading it again, and replacing the songbird folder with a new one.

  21. Jaydub2000 Mar 4, 2009 5:34 pm Permalink

    Was the iTunes using cover flow or list view? Sounds like a minor detail, but it seems to make a sizable memory difference for me.

  22. cwilliams Mar 4, 2009 6:31 pm Permalink

    Been trying out a nightly, Songbird has come along way. Looking to make it my primary media player now. I’ve made a wishlist of bugs, features, and enhancements I’d like to see in Songbird here:

    http://sites.google.com/site/songbirdwish/Home

    I’ll be more active in Bugzilla as well.

  23. Mattias Mar 5, 2009 10:08 pm Permalink

    Totally awsome with the improved memoryusage! Thanks!

  24. Maksim Mar 6, 2009 3:30 am Permalink

    what about comparing with really good and modest player like foobar2000?

  25. Erik ch Mar 12, 2009 10:03 am Permalink

    we have bad news…
    Itunes has launch 8.1 of thir jukebox
    and can be more features, like low memory use. I saw on this news
    http://blog.wired.com/business/2009/03/performance-gai.html

  26. Chris Mar 22, 2009 4:35 pm Permalink

    Love the songbird update…so much less cpu usage.

    I would have to say that the best music player in terms of memory usage is musikcube. It’s very basic though, and doesn’t hold a candle to songbirds functionality.

  27. rtrty Apr 15, 2009 11:46 pm Permalink

    we have bad news

  28. Laser Welding Machin Apr 15, 2009 11:46 pm Permalink

    Totally awsome with the improved memoryusage! Thanks!

  29. gögüs estetiği Aug 19, 2009 3:04 pm Permalink

    In 1.1 a whole heap of stuff was rewritten, and a side effect was that now only songbird freezes up, and eats up 1 CPU core (so the system is still totally usable). So obviously the changes brought about much better and safer code, even during crashes..