"Provided by Ubuntu" leaks memory

Bug #577540 reported by Olivier Tilloy on 2010-05-08
This bug affects 3 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Olivier Tilloy

Bug Description

Binary package hint: software-center

This is observable with software center 2.0.3 and the trunk branch as well.

1) Launch software center and the system monitor to watch the memory consumption
2) Click on the "Provided by Ubuntu" entry on the left, wait for the list to (re-)load
3) Repeat step 2 several times.
4) verify (using htop or top or gnome-system-monitor) that the memory increase considerable (~10mb or more)
5) install software-center from lucid-proposed
6) restart software-center and repeat step 2
7) verify that the memory consumption does increase much less

Expected result: the memory consumption increases the first time, then remains stable.

Current result: the memory consumption increases by approximately 12MB every time the list is re-loaded, and is never re-claimed. This eventually results in a very high memory consumption.

Related branches

Confirming the here. It has been split up from bug #573000.

Changed in software-center (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Michael Vogt (mvo) wrote :

Thanks for the bugreport.

I can reproduce this here, Olivier hinted that something like this:
 === modified file 'softwarecenter/view/channelpane.py'
--- softwarecenter/view/channelpane.py 2010-04-27 14:11:04 +0000
+++ softwarecenter/view/channelpane.py 2010-05-09 22:37:25 +0000
@@ -101,6 +101,9 @@
         if old_model is not None:
             old_model.active = False
+ print "clear"
+ old_model.clear()
+ del old_model
         gobject.idle_add(self._make_new_model, query, self.refresh_seq_nr)
         return False

should fix it (for all the places where we use this contruct). And without the "print" ;)

We should also SRU it.


Olivier Tilloy (osomon) wrote :

Note that the attached branch also improves a lot the situation described in bug #573000.

Michael Vogt (mvo) on 2010-05-10
Changed in software-center (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium


I followed the steps to reproduce, memory consumption keeps growing every time i clicked on Provided by Ubuntu. Memory consumption raised about 15mb per click.

Michael Vogt (mvo) wrote :

@Ken: could you please test the branch that should fix it. Run (in a terminal):
$ bzr co lp:~ubuntu-core-dev/software-center/lucid
$ cd lucid
$ PYTHONPATH=. ./software-center

Olivier Tilloy (osomon) wrote :

I tested the lucid branch, and the situation is much better, but a small quantity of memory is still leaked every time one clicks on "Provided by Ubuntu" (less than one MB, to be compared to more than 10MB before the patch).

Michael Vogt (mvo) on 2010-05-11
description: updated

Accepted software-center into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in software-center (Ubuntu Lucid):
status: Triaged → Fix Committed
tags: added: verification-needed
Paul Elliott (omahn) wrote :

Testing with the original software-center 2.0.3 showed an increase of ~10 megabytes on each reload of the software list, 2.0.4 from lucid-proposed no longer leaks to this extent although usage of the app does still increase slightly over time. As the remaining leak is small I'm happy to mark this as verification-done.

tags: added: verification-done
removed: verification-needed

Testing with 2.0.4 from lucid-proposed.

First click = 7.7mb memory increased
Second click = 3.7 memory decreased
Third click = 0.3mb memory increased
Fouth click = same from above. less than 1mb memory increased
Fifth to sixth = same, less than 1mb memory increased

Launchpad Janitor (janitor) wrote :
Download full text (3.3 KiB)

This bug was fixed in the package software-center - 2.1.0

software-center (2.1.0) maverick; urgency=low

  [ Matthew McGowan ]
  * merged lp:~mmcg069/software-center/backforward-redraw-fix
  * make the overlaywithpixbuf cellrenderer inherit from a text
    cellrenderer, does away with the need to have 1px column in the
    appview for accessibility reasons.
  * add nice animation to pathbar elements

  [ Olivier Tilloy ]
  * fix LP: #564785:
    "each row has a progress bar (which itself never contains any text)"
  * show download completion status (LP: #460888)
  * add "bottom border" effect (LP: #439621)
  * add "history" GUI that reads /var/log/apt/history.log
  * Re-claim used memory after updating an existing AppStore with a
    new one (LP: #577540)
  * Fix the database update when run with a Turkish locale
    (patch by M. Vefa Bicakci). LP: #581207
  * Make buttons activate on mouse up, fix other inconsistencies
    in list view button operation (LP: #514835)

  [ Jacob Johan Edwards ]
  * merged lp:~j-johan-edwards/software-center/smooth_search, this
    massively improves the search and stops it from flickering
    (LP: #570682)
  * merged lp:~j-johan-edwards/software-center/action_bar that provides
    the foundation for the "custom packages list" branch
  * merged lp:~j-johan-edwards/software-center/unbranded_icons to
    provide a set of unbranded icons for e.g. Debian
  * merged lp:~j-johan-edwards/software-center/custom_lists to
    implement https://wiki.ubuntu.com/SoftwareCenter#Custom%20package%20lists

  [ Ken van Dine ]
  * allow sharing apps via gwibber and apturl

  [ Julian Andres Klode ]
  * merged lp:~juliank/software-center/debian that include fixes and
    updates for the new python-apt 0.8 API

  [ Kiwinote ]
  * data/featured.menu.in:
    - Update featured applications list per Desktop team (LP: #548534)
    - Feature 'fretsonfire-game' rather than 'fretsonfire' (LP: #538646)
  * softwarecenter/view/app.py:
    - Set correct sensitivity of 'edit > undo,redo,cut,copy,delete,select_all'
      (LP: #439613, LP: #530194)

  [ Michael Vogt ]
  * softwarecenter/view/appview.py:
    - simplify application list buildup and improve responsiveness
  * softwarecenter/view/*pane.py:
    - fix crash when ngettext is translated without %s format
      (LP: #449053)
  * add test/Makefile and ensure all tests are run in the bzr-buildpackage
    pre-build hook
  * softwarecenter/db/database.py, softwarecenter/view/appdetailsview.py:
    - add "StoreDatabase.get_iconname()" and use it
  * softwarecenter/view/appview.py:
    - small cleanups
  * softwarecenter/view/availablepane.py:
    - add iconnames when installing custom lists
  * softwarecenter/view/pendingview.py:
    - look for "appname" and "pkgname" (in this order) when showing
      the progress information
  * update about (LP: #566571)
  * merged lp:~apulido/software-center/mago_fix (many thanks to Ara Pulido)
  * data/unbranded-software-center.desktop.in:
    - add unbranded desktop file
  * softwar...


Changed in software-center (Ubuntu):
status: Confirmed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 2.0.4

software-center (2.0.4) lucid-proposed; urgency=low

  * Re-claim used memory after updating an existing AppStore with a
    new one (LP: #577540), thanks to Olivier Tilloy
 -- Michael Vogt <email address hidden> Tue, 11 May 2010 23:32:56 +0200

Changed in software-center (Ubuntu Lucid):
status: Fix Committed → Fix Released
Olivier Tilloy (osomon) wrote :

I'm reopening this bug as I can observe the original leak both in software-center 2.1.0~ppa1 (from software-store-developers PPA) and in the trunk (tested with revision 808).
Either the patch got accidentally lost, or another very similar leak was introduced.
Here are some measurements carried out on trunk:

Memory used after startup: 41.2 MB
Click "Provided by Ubuntu" #1: 57.5 MB (+16.3 MB)
Click "Provided by Ubuntu" #2: 70.1 MB (+12.6 MB)
Click "Provided by Ubuntu" #3: 80.6 MB (+10.5 MB)
Click "Provided by Ubuntu" #4: 92.8 MB (+12.2 MB)
Click "Provided by Ubuntu" #5: 105.0 MB (+12.2 MB)
Click "Provided by Ubuntu" #6: 117.2 MB (+12.2 MB)
Click "Provided by Ubuntu" #7: 129.4 MB (+12.2 MB)
Click "Provided by Ubuntu" #8: 141.6 MB (+12.2 MB)
Click "Provided by Ubuntu" #9: 153.8 MB (+12.2 MB)

Changed in software-center (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
status: Fix Released → Confirmed
Olivier Tilloy (osomon) wrote :

The leak was re-introduced at revision 797 which fixed bug #584969.

Gary Lasker (gary-lasker) wrote :

Thanks for the catch, Olivier! You are correct, the index_map clears should not have been removed in the fix for the other bug. Your fix is merged to trunk.

Thanks again!

Changed in software-center (Ubuntu):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-center - 2.1.2

software-center (2.1.2) maverick; urgency=low

  [ Gary Lasker ]
  * softwarecenter/view/viewswitcher.py:
    - only reselect a channel node when a model is available
      (LP: #578497)
  * fix "List view forgets selected row" regression (LP: #584969)
  * softwarecenter/view/availablepane.py:
    - fix broken searches
  * data/ui/SoftwareCenter.ui,
    - bit of navhistory code housekeeping
    - add navhistory back/forward actions and corresponding
      menu items
    - integrate navhistory actions with custom back/forward
    - add accelerator keys for navhistory actions
  * merged lp:~osomon/software-center/memory_leak, fixes
    memory leak regression (LP: #577540), thanks Olivier Tilloy!
  * softwarecenter/backend/aptd.py:
    - fix error when updating software sources (LP: #586623)
  * merged lp:~osomon/software-center/memory_leak, disconnect
    signals to allow appstore to be deleted, thanks Olivier Tilloy!
  * merged lp:~osomon/software-center/fix_appstore_update, remake
    pkgname_index_map correctly, many thanks Olivier!
  * softwarecenter/view/historypane.py:
    - fix UnboundLocalError if history.log is empty
  * merged lp:~hellium/software-center/installed-date, history
    pane log parsing merged to AptHistory, implement "Installed since"
    feature in the details view, many thanks Geliy Sokolov!
  * softwarecenter/apt/apthistory.py,
    - fix launch error in the case where there is no
      history.log file (LP: #591590)

  [ Michael Vogt ]
  * merged lp:~glatzor/software-center/glatzor to get improved
    aptdaemon API
  * test/test_aptd.py:
    - update tests to work with new defered magic API
  * debian/control:
    - update dependencies on aptdaemon
  * merged lp:~mmcg069/software-center/improve-appview-persistence
    (many thanks!)
  * softwarecenter/view/installedpane.py:
    - do not crash if model is None (LP: #586306)
  * merged lp:~gary-lasker/software-center/hide_nonapps_pkgs_xapian
    many thanks to Jacob Johan Edwards and Gary
  * softwarecenter/apt/apthistory.py:
    - add test (and test data) for AptHistory class
    - be more async friendly and add test for async
  * merge lp:~mvo/software-center/launchpad-login branch that
    provides the infrastructure for LP login/API calls and supports
    displaying private PPAs
  * softwarecenter/apt/apthistory.py:
    - be more robust against invalid entries (LP: #590281), this
      also need a python-debian fix to be fully working
 -- Michael Vogt <email address hidden> Thu, 10 Jun 2010 12:04:34 +0200

Changed in software-center (Ubuntu):
status: Fix Committed → Fix Released
tags: added: testcase
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers