[Bug 1031449] Re: rhythmbox leaking memory

Matthew Fischer 1031449 at bugs.launchpad.net
Wed Jun 12 14:24:37 UTC 2013


** Changed in: rhythmbox (Ubuntu Precise)
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1031449

Title:
  rhythmbox leaking memory

Status in The Rhythmbox Music Management Application:
  New
Status in Ubuntu on the Nexus 7:
  Invalid
Status in “rhythmbox” package in Ubuntu:
  Fix Released
Status in “rhythmbox” source package in Precise:
  In Progress
Status in “rhythmbox” source package in Quantal:
  Fix Released

Bug description:
  [Impact]
  Large memory leak in Rhythmbox that manifests itself primarily when changing tracks. The leak for changing through 50 tracks is around 17MB. More tracks = more leaks. This bug hits memory constrained platforms especially hard, but all users should be able to listen to music for an afternoon without running out of memory.

  [Test Case]
  I loaded 50 random MP3 tracks from my collection onto a clean system. Some had album art, some did not. Lengths varied from 1 min to 20 mins, most were 3-4 mins long. I started watching rhythmbox with smem, updating every 10 seconds. I then started ryhthmbox and began playing audio. I did two test cases then:

  1) I let each track play for 1-2 seconds and then skipped to the next
  track. The original precise version 2.96-0ubuntu4.2 leaks heavily as
  the tracks cycle:

  foo at localhost:~$ while true; do smem -H -P ^rhythmbox; sleep 10; done
    779 mfisch      rhythmbox                          0    25568    27387    37380 
    779 mfisch      rhythmbox                          0    32632    34726    45428 
    779 mfisch      rhythmbox                          0    33564    35664    46372 
    779 mfisch      rhythmbox                          0    35132    37194    47864 
    779 mfisch      rhythmbox                          0    36664    38726    49396 
    779 mfisch      rhythmbox                          0    38180    40272    50972 
    779 mfisch      rhythmbox                          0    40020    42108    52804 
    779 mfisch      rhythmbox                          0    41204    43304    54012 
    779 mfisch      rhythmbox                          0    41220    43300    53988 
    779 mfisch      rhythmbox                          0    41244    43343    54052 
    779 mfisch      rhythmbox                          0    42340    44444    55160 
    779 mfisch      rhythmbox                          0    50288    52391    63120 

  2) Another way was just to load the tracks and let them play. I
  watched this one for over 90 minutes. It still leaks, just more
  slowly, especially when it gets into some of the longer tracks.

  mfisch at localhost:~$ while true; do smem -P ^rhythmbox; sleep 120; done
    765 mfisch      rhythmbox                          0    32136    35148    46948 
    765 mfisch      rhythmbox                          0    33800    35997    46956 
    765 mfisch      rhythmbox                          0    33800    35999    46960 
    765 mfisch      rhythmbox                          0    34248    36456    47464 
    765 mfisch      rhythmbox                          0    34240    36450    47460 
    765 mfisch      rhythmbox                          0    34244    36452    47460 
    765 mfisch      rhythmbox                          0    34248    36456    47464 
    765 mfisch      rhythmbox                          0    34308    36520    47532 
    765 mfisch      rhythmbox                          0    34308    36520    47532 
    765 mfisch      rhythmbox                          0    34312    36524    47536 
    765 mfisch      rhythmbox                          0    34312    36524    47536 
    765 mfisch      rhythmbox                          0    34904    37118    48132 
    765 mfisch      rhythmbox                          0    34904    37118    48132 
    765 mfisch      rhythmbox                          0    35032    37244    48256 
    765 mfisch      rhythmbox                          0    35032    37244    48256 
    765 mfisch      rhythmbox                          0    35408    37620    48632 
    765 mfisch      rhythmbox                          0    35408    37620    48632 
    765 mfisch      rhythmbox                          0    35800    38018    49036 
    765 mfisch      rhythmbox                          0    35800    38018    49036 
    765 mfisch      rhythmbox                          0    36172    38388    49404 
    765 mfisch      rhythmbox                          0    36172    38388    49404 
    765 mfisch      rhythmbox                          0    36412    38630    49648 
    765 mfisch      rhythmbox                          0    36412    38630    49648 
    765 mfisch      rhythmbox                          0    36720    38936    49952 
    765 mfisch      rhythmbox                          0    36720    38936    49952 
    765 mfisch      rhythmbox                          0    37020    39238    50256 
    765 mfisch      rhythmbox                          0    37020    39238    50256 
    765 mfisch      rhythmbox                          0    37384    39600    50616 
    765 mfisch      rhythmbox                          0    37384    39600    50616 
    765 mfisch      rhythmbox                          0    37688    39904    50920 
    765 mfisch      rhythmbox                          0    37688    39904    50920 
    765 mfisch      rhythmbox                          0    37988    40204    51220 
    765 mfisch      rhythmbox                          0    37988    40204    51220 
    765 mfisch      rhythmbox                          0    38296    40512    51528 
    765 mfisch      rhythmbox                          0    38296    40512    51528 
    765 mfisch      rhythmbox                          0    38300    40516    51532 
    765 mfisch      rhythmbox                          0    38300    40516    51532 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    38688    40906    51924 
    765 mfisch      rhythmbox                          0    39096    41312    52328

  
  [Regression Potential]
  The potential here is that Rhythmbox will not work correctly and may crash. Freeing memory that is actually needed later will result in a segfault. If this happened users would experience crashes when playing music. However, I feel this risk is mitigated via testing and the fact that this code has been used upstream for over a year now. I did check the gir library because I was concerned that a breakage may affect other pieces, but it appears that only rhythmbox itself and plugins uses it.

  [Explanation of Fix]
  I cherry picked commits from June of 2012 from Rhythmbox's git tree to build the patch. These commits are already in use in Q and R. The commits I pulled are from the 2 upstream gnome bugs: 
  https://bugzilla.gnome.org/show_bug.cgi?id=677738
  https://bugzilla.gnome.org/show_bug.cgi?id=678208

  After examining these commits, I found that 7ea940f doesn't apply, the file it patches doesn't exist in this version. Also commit 5b281f5 was 
  superceded by 7cdf4cd. This leaves the following commits in the patch: 0c5a47c 7cdf4cd fc1e8ca 3dec1ff ad8ab01 96aa2cd 5b281f5 195c2a7 8999cca

  I then built a copy of rhythmbox and installed it. Here are the
  results from running Test 1 from above with the patch applied, as you
  can see the mem leak is corrected:

  ufa at localhost:~$ while true; do smem -H -P ^rhythmbox; sleep 10; done
    806 ufa      rhythmbox                          0    25188    27072    36836 
    806 ufa      rhythmbox                          0    33168    35348    45840 
    806 ufa      rhythmbox                          0    33460    35634    46120 
    806 ufa      rhythmbox                          0    33836    36022    46520 
    806 ufa      rhythmbox                          0    33940    36094    46560 
    806 ufa      rhythmbox                          0    34156    36306    46768 
    806 ufa      rhythmbox                          0    34440    36608    47088 
    806 ufa      rhythmbox                          0    34140    36324    46820 
    806 ufa      rhythmbox                          0    33844    35992    46452 
    806 ufa      rhythmbox                          0    33896    36065    46548 
    806 ufa      rhythmbox                          0    36000    38189    48696 
    806 ufa      rhythmbox                          0    34724    36880    47364 



  (original description)
  Memory usage : 10.9% and constantly increasing (that's over 400 MB on my system with 4 GB)

  Playing a playlist of MP3 files.

  This can't be normal, right?

  -Lev

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: rhythmbox 2.96-0ubuntu4.1
  ProcVersionSignature: Ubuntu 3.2.0-27.43-generic 3.2.21
  Uname: Linux 3.2.0-27-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 2.0.1-0ubuntu11
  Architecture: amd64
  Date: Tue Jul 31 14:07:07 2012
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
  ProcEnviron:
   LANGUAGE=en_CA:en
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_CA.UTF-8
   SHELL=/bin/bash
  SourcePackage: rhythmbox
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/rhythmbox/+bug/1031449/+subscriptions



More information about the Ubuntu-sponsors mailing list