Large memory leak in nm-applet

Bug #930491 reported by Harm van Bakel
182
This bug affects 36 people
Affects Status Importance Assigned to Milestone
network-manager-applet (Ubuntu)
Fix Released
Critical
Mathieu Trudel-Lapierre
Precise
Fix Released
Critical
Mathieu Trudel-Lapierre

Bug Description

In an up-to-date precise install, memory usage by nm-applet climbs rapidly to hundreds of Mb within an hour after it's started. Valgrind log attached.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: network-manager-gnome 0.9.2.0+git.20120126t000800.5151959-0ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-15.24-generic 3.2.5
Uname: Linux 3.2.0-15-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
Date: Fri Feb 10 19:23:00 2012
IfupdownConfig:
 auto lo
 iface lo inet loopback
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120201.1)
IpRoute:
 default via 192.168.2.1 dev wlan0 proto static
 169.254.0.0/16 dev wlan0 scope link metric 1000
 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.15 metric 2
NetworkManager.state:
 [main]
 NetworkingEnabled=true
 WirelessEnabled=true
 WWANEnabled=true
 WimaxEnabled=true
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: network-manager-applet
UpgradeStatus: No upgrade log present (probably fresh install)
nmcli-con:
 NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH
 ribeira f828a6c2-179f-41ab-acdd-bf27da31c6d5 802-11-wireless 1328916417 Fri 10 Feb 2012 06:26:57 PM EST yes no /org/freedesktop/NetworkManager/Settings/0
nmcli-dev:
 DEVICE TYPE STATE DBUS-PATH
 wlan0 802-11-wireless connected /org/freedesktop/NetworkManager/Devices/1
 eth0 802-3-ethernet unavailable /org/freedesktop/NetworkManager/Devices/0
nmcli-nm:
 RUNNING VERSION STATE NET-ENABLED WIFI-HARDWARE WIFI WWAN-HARDWARE WWAN
 running 0.9.3.0 connected enabled enabled enabled enabled disabled

Revision history for this message
Harm van Bakel (hvbakel) wrote :
Revision history for this message
Harm van Bakel (hvbakel) wrote :

The size of the memory leak appears to be proportional to the number of available wireless networks. At a location with only a few networks, memory usage by nm-applet barely increases. At home, with about 60+ detected access points, memory increases at a rate of 2-3 Mb per minute. I have experienced this problem since the first released nm-applet version in Natty.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager-applet (Ubuntu):
status: New → Confirmed
Revision history for this message
keith burnett (ping-keith-gmail) wrote :

On Precise 64 bit, updated today but on kernel 3.2.0-14-generic

I can see this bug when using a wifi dongle (Netgear WG111v3, default drivers) on my desktop PC.

3 wifi connections visible, after one hour, top shows nm-applet res use increasing from 16Mb to 25Mb.

Rebooting and using just wired connection, res remains stable at 16Mb

Revision history for this message
Graham Lucking (lucking) wrote :

I have the same problem. The top command shows nm-applet starting below 2% memory usage of 1GB memory and slowly rising over time. I have recorded nm-applet memory usage at plus 26% of 1GB of RAM.

At plus 9% memory usage the network app indicator menu becomes unresponsive. It is not possible to disconnect either the wired or wireless connection, or disable networking or wireless. Clicking on these lines in the menu has no effect. It is still possible to disconnect using the slider options in the System Settings Network utility but once switched off by using that utility wired or wireless connections cannot be switched back on using the network app-indicator menu but only by the System Settings Netwrok utility.

Furthermore, if the menu is left open it blinks out of existence and then re-appears and does this frequently but not rapidly.

Revision history for this message
Harm van Bakel (hvbakel) wrote :

I also previously filed a memory-leak bug report against nm-applet in natty (https://bugs.launchpad.net/bugs/780602), which I think got incorrectly marked as a duplicate of #779754 (though it shares some characteristics). In the comments of #780602 there is a pretty detailed analysis of several memory leaks by 'jkl102001', which might still be relevant here.

Revision history for this message
Doug McMahon (mc3man) wrote :

This appears to be something quite new here where with the current network-manager & network-manager-gnome packages am seeing about 80MB/hr
Downgrading all installed in bulk and things return to normal -

libnm-glib4_0.9.2.0+git201201101813.0b30200-0ubuntu2_i386.deb
libnm-util2_0.9.2.0+git201201101813.0b30200-0ubuntu2_i386.deb
network-manager_0.9.2.0+git201201101813.0b30200-0ubuntu2_i386.deb

libnm-gtk0_0.9.1.90-0ubuntu7_i386.deb
libnm-gtk-common_0.9.1.90-0ubuntu7_all.deb
gir1.2-networkmanager-1.0_0.9.2.0+git201201101813.0b30200-0ubuntu2_i386.deb

network-manager-gnome_0.9.1.90-0ubuntu7_i386.deb
libnm-glib-vpn1_0.9.2.0+git201201101813.0b30200-0ubuntu2_i386.deb

Upgrading back in order the big leak didn't restart until network-manager-gnome was upgraded, then downgrading just network-manager-gnome has again restored things back to normal

Revision history for this message
Sutram (sutram) wrote :

I have the same issue with the latest version of network manager. I am running an updated 12.04 i386 version of Xubuntu.

Revision history for this message
Jane Atkinson (irihapeti) wrote :

Asus EeePC 900, 1GB RAM, up-to-date install of precise

nm-applet was using 6.4 MB of memory at initial boot.

Five hours later, that had increased to 49.1 MB, 6.1% of total.

There are about 18 or so WiFi access points visible.

So far, I've not noticed any unresponsive behaviour in the applet.

Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking High. bug 931207 also has a valgrind log.

Changed in network-manager-applet (Ubuntu):
importance: Undecided → High
Revision history for this message
Spenser Gilliland (spenser-gilliland) wrote :

I've got 1.6 GB worth of memory usage on my precise install. It's the highest usage process on my system.

Revision history for this message
adam@adamhooper.com (adam-adamhooper) wrote :

Workaround:

Before going to bed, open a terminal and "killall -9 nm-applet" (your computer will stay connected to the network)
When you next need to switch networks: "nm-applet &"

If I leave my computer idling for more than 24 hours, it gets so unresponsive I can't even open a terminal to resuscitate it.

Revision history for this message
Andy Whitcroft (apw) wrote :

Am seeing this on both 32bit and 64bit installs.

Revision history for this message
David Gómez (dabisu) wrote :

471Mb and growing...

Revision history for this message
Doug McMahon (mc3man) wrote :

Those affected should upgrade network-manager-gnome to 0.9.2.0+git.20120126t000800.5151959-0ubuntu2 and after a log out/in recheck usage/increase

Here I currently have 20 available networks, previously that would have caused a steady 1MiB+ per min increase, currently it's now remaining static, no increase of any concern

Revision history for this message
Harm van Bakel (hvbakel) wrote :

Things definitely improved with the new network-manager-gnome package, but a smaller leak still remains. I'm now seeing an increase of ~1Mb every 6-8 minutes, compared to several Mb/min.

Revision history for this message
Steve Langasek (vorlon) wrote :

Marking this critical; my machine took minutes to swap gnome-screensaver back in because nm-applet was gobbling up all the RAM. This makes systems quite unusable very quickly.

I'm happy to try to debug this in realtime if you need help reproducing it, Mathieu.

Changed in network-manager-applet (Ubuntu):
importance: High → Critical
Changed in network-manager-applet (Ubuntu Precise):
milestone: none → ubuntu-12.04-beta-1
tags: added: rls-mgr-p-tracking
Revision history for this message
Harm van Bakel (hvbakel) wrote :

New valgrind log attached for network-manager-gnome 0.9.2.0+git.20120126t000800.5151959-0ubuntu2

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I think I largely got this under control and I'm just about to upload a fix for it to precise, pending another bug to receive a Feature Freeze exception (or repacking with just the leak fixes if that takes too long).

I've also put the same package as will be uploaded; in my PPA: https://launchpad.net/~mathieu-tl/+archive/ppa/+sourcepub/2265268/+listing-archive-extra

Changed in network-manager-applet (Ubuntu Precise):
status: Confirmed → In Progress
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
Revision history for this message
Hernando Torque (htorque) wrote :

Mem usage stayed constant for almost two hours with Mathieu's PPA packages, so this leak seems fixed. Thanks! :-)

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Hernando, thanks for confirming this; I'm uploading the fixes now.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager-applet - 0.9.2.0+git.20120126t000800.5151959-0ubuntu3

---------------
network-manager-applet (0.9.2.0+git.20120126t000800.5151959-0ubuntu3) precise; urgency=low

  * debian/patches/lp829673_gconf_hide_applet.patch: allow toggling the applet
    visibility. (LP: #829673)
  * debian/patches/nm-applet-use-indicator.patch: completely replace the old
    wireless menu item creation code overriding NMNetworkMenuItem objects to
    rewrite it more simply with GtkImageMenuItems. This should really take care
    of the memory leaks. (LP: #930491)
 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 20 Feb 2012 13:58:49 -0500

Changed in network-manager-applet (Ubuntu Precise):
status: In Progress → Fix Released
Revision history for this message
Marcin Sochacki (wanted) wrote :

I'm seeing a similar issue in Ubuntu 11.04 (Natty), however I don't know how to confirm whether this is the same bug or a different one. After about 2 weeks since startup nm-applet has grown to VSZ = 640 MB, RSS = 170 MB. This is a laptop and I'm using suspend a lot.

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
wanted 1462 0.0 8.3 642292 170408 ? SLl Mar15 11:35 nm-applet --sm-disable

Maybe the patch could be backported to Natty?

Revision history for this message
Shivam Sharma (shivams-cool) wrote :

In 2015, on Linux Mint 17.1 (based on Ubuntu 14.04), the issue is still there. 700MB and still growing.

Revision history for this message
Slavko (eslavko) wrote :

Ubuntu 14.04 64 bit and leak is still present. 700Mb after 3 hours...

Revision history for this message
Slavko (eslavko) wrote :

...
I tried to kill and relaunch with
killall nm-applet
nm-applet &

It's works. The memory is released and applet running but after few seconds I got this in my terminal:

(nm-applet:32662): nm-applet-WARNING **: Could not find ShellVersion property on org.gnome.Shell after 5 tries

And machine doesn't have wireless adapter.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.