You are not logged in.

#1 2017-10-21 15:50:56

Eon
Member
From: Earth
Registered: 2015-09-29
Posts: 76

[SOLVED] A question regarding nm-applet (memory usage)

Hi,

So I wanted to ask this question from some time now, but wasn't getting enough time from daily life routine. So, I notice that fresh boot of my BL setup takes about ~205MiB as it shows me in conky, but I thought is that accurate usage? So I was crawling the forums to find any tools or programs to give me accurate or very precise memory usage data and I found >this< forum post by HoaS where he mentioned a program called "ps_mem".
So I rebooted BunsenLabs and ran it. This is the output:

root@debian:~# ps_mem 
 Private  +   Shared  =  RAM used	Program

164.0 KiB +  50.0 KiB = 214.0 KiB	gnome-pty-helper
252.0 KiB +  59.0 KiB = 311.0 KiB	agetty
308.0 KiB +  60.5 KiB = 368.5 KiB	irqbalance
316.0 KiB + 111.0 KiB = 427.0 KiB	cron
340.0 KiB +  95.0 KiB = 435.0 KiB	syndaemon
560.0 KiB +  23.5 KiB = 583.5 KiB	ssh-agent
412.0 KiB + 184.0 KiB = 596.0 KiB	xfconfd
668.0 KiB + 196.0 KiB = 864.0 KiB	dbus-launch (2)
808.0 KiB +  82.0 KiB = 890.0 KiB	systemd-logind
720.0 KiB + 197.0 KiB = 917.0 KiB	gconfd-2
864.0 KiB + 323.0 KiB =   1.2 MiB	gvfsd
  1.1 MiB + 110.5 KiB =   1.2 MiB	smartd
  1.0 MiB + 262.0 KiB =   1.2 MiB	sudo
  1.1 MiB + 342.0 KiB =   1.5 MiB	ntpd
  1.3 MiB + 349.0 KiB =   1.6 MiB	gvfsd-fuse
  1.6 MiB +  83.0 KiB =   1.7 MiB	systemd-journald
  1.2 MiB + 669.0 KiB =   1.9 MiB	at-spi2-registryd (2)
  1.8 MiB +  99.5 KiB =   1.9 MiB	rsyslogd
  1.4 MiB + 574.5 KiB =   2.0 MiB	sshd
  1.9 MiB + 117.5 KiB =   2.0 MiB	systemd-udevd
  1.2 MiB + 973.5 KiB =   2.1 MiB	xfce4-notifyd
  1.5 MiB + 708.0 KiB =   2.2 MiB	upowerd
  2.3 MiB + 415.0 KiB =   2.7 MiB	polkitd
  1.9 MiB + 836.5 KiB =   2.8 MiB	at-spi-bus-launcher (2)
  1.6 MiB +   1.2 MiB =   2.8 MiB	(sd-pam) (2)
  2.3 MiB + 528.5 KiB =   2.8 MiB	wpa_supplicant
  2.4 MiB + 608.0 KiB =   3.0 MiB	gnome-keyring-daemon
  2.4 MiB + 934.0 KiB =   3.3 MiB	dbus-daemon (5)
  2.3 MiB +   1.1 MiB =   3.4 MiB	tint2
  1.7 MiB +   1.7 MiB =   3.4 MiB	polkit-gnome-authentication-agent-1
  3.0 MiB + 456.0 KiB =   3.5 MiB	ModemManager
  2.6 MiB + 969.0 KiB =   3.5 MiB	conky
  2.5 MiB +   1.1 MiB =   3.7 MiB	lightdm (2)
  2.0 MiB +   1.7 MiB =   3.7 MiB	systemd (3)
  3.6 MiB +   1.3 MiB =   4.9 MiB	openbox
  4.2 MiB +   1.1 MiB =   5.2 MiB	pulseaudio
  4.1 MiB +   1.2 MiB =   5.3 MiB	bash (2)
  3.4 MiB +   2.1 MiB =   5.5 MiB	light-locker
  4.6 MiB +   1.3 MiB =   6.0 MiB	NetworkManager
  5.3 MiB +   1.9 MiB =   7.2 MiB	clipit
  8.4 MiB +  54.0 KiB =   8.5 MiB	dhclient
  6.1 MiB +   2.5 MiB =   8.6 MiB	xfce4-power-manager
  6.4 MiB +   3.0 MiB =   9.4 MiB	volumeicon
 15.7 MiB + 459.5 KiB =  16.1 MiB	compton
 13.4 MiB +   3.5 MiB =  16.9 MiB	nm-applet
 24.5 MiB +   4.1 MiB =  28.6 MiB	x-terminal-emul
 31.9 MiB +   1.1 MiB =  33.0 MiB	Xorg
---------------------------------
                        219.7 MiB
=================================

One thing I found curious is why nm-applet takes up this much RAM or is it completely normal?
Also, I find x-terminal-emul seems bit bulky or resource-consuming. Just a personal opinion though.  tongue

Last edited by Eon (2017-10-27 06:22:13)

Offline

#2 2017-10-21 16:18:05

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [SOLVED] A question regarding nm-applet (memory usage)

Eon wrote:

why nm-applet takes up this much RAM or is it completely normal?

It is a resource-hog, yes hmm

You can drop that, NetworkManager and ModemManager and use /etc/network/interfaces instead to reduce memory consumption significantly and also ensure a less buggy, more consistent connection.

I may have written a guide about that, can't remember specifically though — post back if you need more assistance.

I find x-terminal-emul seems bit bulky or resource-consuming

+1, I agree.

Try this:

sudo apt install rxvt-unicode-256color
sudo update-alternatives --set x-terminal-emulator /usr/bin/urxvt

The little terminal launcher should then immediately switch to a *much* lighter alternative.

Offline

#3 2017-10-21 16:25:07

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [SOLVED] A question regarding nm-applet (memory usage)

Can't resist this one...

Eon wrote:
  4.1 MiB +   1.2 MiB =   5.3 MiB	bash (2)

yikes

My system:

608.0 KiB +   8.0 KiB = 616.0 KiB	mksh

cool

HowTo:

sudo apt install mksh
zcat /usr/share/doc/mksh/examples/dot.mkshrc.gz > ~/.mkshrc # configuration file
chsh -s /bin/mksh

There is also a backported version with some nice fixes:

https://packages.debian.org/jessie-backports/mksh

And I have the very latest release:

https://download.opensuse.org/repositor … ebian_8.0/

Offline

#4 2017-10-22 11:02:20

Eon
Member
From: Earth
Registered: 2015-09-29
Posts: 76

Re: [SOLVED] A question regarding nm-applet (memory usage)

Hi HoaS,

Thank you for your reply! switching to rxvt almost saves ~20MiB of memory. 8o
About mksh, I think I need some research to do before switching to mksh. I think I am too much used to bash scripts haha, and associative arrays in bash; but thank you for your suggestion though. I learned something new in the process.

You can drop that, NetworkManager and ModemManager and use /etc/network/interfaces instead to reduce memory consumption significantly and also ensure a less buggy, more consistent connection.

By any chance, were you referring to >>this<< guide of yours? It is very briefly explained and I would like to give it a try later when I have some spare time. Once again, thanks. big_smile

Offline

#5 2017-10-22 11:39:36

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [SOLVED] A question regarding nm-applet (memory usage)

Eon wrote:

About mksh, I think I need some research to do before switching to mksh. I think I am too much used to bash scripts haha, and associative arrays in bash

Ah yes, those indispensable associative arrays, they are indeed very popular.

I have to ask though: do you use such arrays much in the interactive shell?

My HowTo just changes the login shell and will not alter the shebang in any of your bash scripts so they should still work fine — my contention is that bash is over-engineered for interactive use and mksh does everything I need at the command line with a smaller overhead (and codebase).

were you referring to >>this<< guide of yours?

Not specifically, although that guide will give similar benefits.

That link is for systemd's native networking tool and that will now work in stretch without hacking (it has an interface-specific wpa_supplicant@.service included) so you could try that but I was talking about Debian's ifupdown toolkit:

https://wiki.debian.org/NetworkConfigur … _Interface

https://wiki.debian.org/WiFi/HowToUse#Command_Line

EDIT: NetworkManager will ignore any devices configured via /etc/network/interfaces but once everything is working with the alternative connection system then it can be disabled with:

sudo systemctl disable {Network,Modem}Manager

And stop nm-applet from starting with:

cp /etc/xdg/autostart/nm-applet.desktop ~/.config/autostart && echo "Hidden=true" >> ~/.config/autostart/nm-applet.desktop

Last edited by Head_on_a_Stick (2017-10-22 11:46:53)

Offline

#6 2017-10-26 14:00:39

Eon
Member
From: Earth
Registered: 2015-09-29
Posts: 76

Re: [SOLVED] A question regarding nm-applet (memory usage)

Please forgive me for awfully late reply! Life is pretty resource-hoggy at times haha. tongue

Head_on_a_Stick wrote:

do you use such arrays much in the interactive shell?

Nope, not that often, but I find that very handy and useful at times haha. ^^

Btw I followed the guide which you posted above, everything worked perfectly, except:

And stop nm-applet from starting with:

cp /etc/xdg/autostart/nm-applet.desktop ~/.config/autostart && echo "Hidden=true" >> ~/.config/autostart/nm-applet.desktop

strangely, this just returns "~/.config/autostart/nm-applet.desktop: Not a directory" message. So, I am not able to stop nm-applet from starting up after boot.

usr@debian:~$ ls .config/autostart/
pulseaudio.desktop

Last edited by Eon (2017-10-26 14:11:49)

Offline

#7 2017-10-27 05:43:19

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: [SOLVED] A question regarding nm-applet (memory usage)

Eon wrote:

And stop nm-applet from starting with:

cp /etc/xdg/autostart/nm-applet.desktop ~/.config/autostart && echo "Hidden=true" >> ~/.config/autostart/nm-applet.desktop

strangely, this just returns "~/.config/autostart/nm-applet.desktop: Not a directory" message. So, I am not able to stop nm-applet from starting up after boot.

don't give up that easily!
the command line looks ok to me; are you sure that is exactly how you entered it?

Offline

#8 2017-10-27 06:21:28

Eon
Member
From: Earth
Registered: 2015-09-29
Posts: 76

Re: [SOLVED] A question regarding nm-applet (memory usage)

ohnonot wrote:
Eon wrote:

And stop nm-applet from starting with:

cp /etc/xdg/autostart/nm-applet.desktop ~/.config/autostart && echo "Hidden=true" >> ~/.config/autostart/nm-applet.desktop

strangely, this just returns "~/.config/autostart/nm-applet.desktop: Not a directory" message. So, I am not able to stop nm-applet from starting up after boot.

don't give up that easily!
the command line looks ok to me; are you sure that is exactly how you entered it?

oh now it worked. Much thanks.
Now that I remember, as why earlier it didn't work because I ran it with root login. Poor me. big_smile

Offline

#9 2017-10-27 12:29:25

Eon
Member
From: Earth
Registered: 2015-09-29
Posts: 76

Re: [SOLVED] A question regarding nm-applet (memory usage)

Btw, I managed to bring the memory usage down to ~150MiB after fresh boot, compared to the previous usage of ~220MiB which I posted above. Thanks to HoaS and ohnonot for kind help.
My OCD seems satisfied, will try to see if I can bring it down to double digit or closer. big_smile

root@debian:~# ps_mem
 Private  +   Shared  =  RAM used	Program

248.0 KiB +  69.0 KiB = 317.0 KiB	agetty
312.0 KiB +  73.5 KiB = 385.5 KiB	irqbalance
332.0 KiB + 117.0 KiB = 449.0 KiB	syndaemon
524.0 KiB +  25.5 KiB = 549.5 KiB	ssh-agent
420.0 KiB + 241.0 KiB = 661.0 KiB	xfconfd
768.0 KiB +  94.0 KiB = 862.0 KiB	systemd-logind
664.0 KiB + 221.0 KiB = 885.0 KiB	dbus-launch (2)
916.0 KiB + 372.0 KiB =   1.3 MiB	gvfsd
  1.0 MiB + 272.0 KiB =   1.3 MiB	sudo
  1.5 MiB +  95.0 KiB =   1.6 MiB	systemd-journald
  1.2 MiB + 552.0 KiB =   1.7 MiB	ntpd
  1.6 MiB + 133.5 KiB =   1.7 MiB	systemd-udevd
  1.3 MiB + 496.0 KiB =   1.8 MiB	gvfsd-fuse
  1.2 MiB + 834.0 KiB =   2.0 MiB	at-spi2-registryd (2)
  2.1 MiB + 334.0 KiB =   2.4 MiB	wpa_supplicant
  1.3 MiB +   1.3 MiB =   2.5 MiB	(sd-pam) (2)
  1.2 MiB +   1.6 MiB =   2.8 MiB	xfce4-notifyd
  2.4 MiB + 553.0 KiB =   3.0 MiB	polkitd
  2.4 MiB + 604.0 KiB =   3.0 MiB	upowerd
  1.9 MiB +   1.1 MiB =   3.1 MiB	at-spi-bus-launcher (2)
  2.6 MiB + 708.0 KiB =   3.3 MiB	gnome-keyring-daemon
  2.3 MiB +   1.0 MiB =   3.3 MiB	dbus-daemon (5)
  1.9 MiB +   1.8 MiB =   3.7 MiB	systemd (3)
  2.5 MiB +   1.3 MiB =   3.8 MiB	lightdm (2)
  3.0 MiB +   1.0 MiB =   4.0 MiB	conky
  2.5 MiB +   1.6 MiB =   4.0 MiB	tint2
  1.8 MiB +   2.5 MiB =   4.3 MiB	polkit-gnome-authentication-agent-1
  3.3 MiB +   1.7 MiB =   5.0 MiB	openbox
  4.5 MiB +   1.3 MiB =   5.8 MiB	bash (3)
  3.9 MiB +   2.7 MiB =   6.6 MiB	light-locker
  7.4 MiB +  43.0 KiB =   7.4 MiB	dhclient
  7.3 MiB +   1.7 MiB =   9.0 MiB	rxvt (2)
  8.5 MiB +   2.8 MiB =  11.4 MiB	xfce4-power-manager
 15.0 MiB + 530.0 KiB =  15.5 MiB	compton
 30.6 MiB +   1.0 MiB =  31.6 MiB	Xorg
---------------------------------
                        150.6 MiB
=================================

Offline

#10 2017-10-28 11:57:21

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: [SOLVED] A question regarding nm-applet (memory usage)

Targets for removal: dhclient (assign static addresses), light-locker (we already have slock installed, use that instead) & compton (eye candy is bloat) ]:D

Offline

Board footer

Powered by FluxBB