Improve memory usage in Debian

New to Debian (Or Linux in general)? Ask your questions here!

Re: Improve memory usage in Debian

Postby PsySc0rpi0n » 2019-06-22 21:55

Ok, I removed 6 addons I probably can leave without. I have closed a few Chromium tabs and closed Atom, Skype, Dropbox (icon next to the clock), Hangouts (icon next to the clock).

Now things looks a lot better.

Here it goes:

Code: Select all
free -h
              total        used        free      shared  buff/cache   available
Mem:            15G        3,5G        7,9G        227M        4,2G         11G
Swap:          4,9G        747M        4,1G


su -c './ps_mem.py'
Password:
Private + Shared = RAM used Program

4.0 KiB + 4.5 KiB = 8.5 KiB uuidd
4.0 KiB + 4.5 KiB = 8.5 KiB startkde
4.0 KiB + 4.5 KiB = 8.5 KiB agetty
4.0 KiB + 8.5 KiB = 12.5 KiB dbus-launch [updated]
4.0 KiB + 9.5 KiB = 13.5 KiB sshd
4.0 KiB + 10.5 KiB = 14.5 KiB dirmngr
8.0 KiB + 8.5 KiB = 16.5 KiB ksysguardd
4.0 KiB + 13.5 KiB = 17.5 KiB obexd
4.0 KiB + 13.5 KiB = 17.5 KiB ck-launch-session
4.0 KiB + 17.5 KiB = 21.5 KiB kwrapper5
4.0 KiB + 21.5 KiB = 25.5 KiB gconf-helper
8.0 KiB + 30.0 KiB = 38.0 KiB dconf-service (2)
44.0 KiB + 2.5 KiB = 46.5 KiB start_kdeinit
40.0 KiB + 8.5 KiB = 48.5 KiB rtkit-daemon
48.0 KiB + 5.5 KiB = 53.5 KiB atd
36.0 KiB + 27.5 KiB = 63.5 KiB sddm-helper
68.0 KiB + 2.5 KiB = 70.5 KiB ssh-agent
4.0 KiB + 75.5 KiB = 79.5 KiB virtlogd
80.0 KiB + 7.5 KiB = 87.5 KiB gpg-agent
116.0 KiB + 7.5 KiB = 123.5 KiB memcached
124.0 KiB + 5.5 KiB = 129.5 KiB cron
128.0 KiB + 7.5 KiB = 135.5 KiB dbus-monitor [updated]
128.0 KiB + 19.5 KiB = 147.5 KiB gconfd-2
148.0 KiB + 15.5 KiB = 163.5 KiB gvfsd-fuse
164.0 KiB + 7.5 KiB = 171.5 KiB irqbalance
176.0 KiB + 4.5 KiB = 180.5 KiB polipo
188.0 KiB + 6.5 KiB = 194.5 KiB lvmetad
252.0 KiB + 5.5 KiB = 257.5 KiB proftpd
232.0 KiB + 58.5 KiB = 290.5 KiB chrome-sandbox
304.0 KiB + 10.5 KiB = 314.5 KiB rpcbind
324.0 KiB + 7.5 KiB = 331.5 KiB acpid
192.0 KiB + 202.5 KiB = 394.5 KiB dnsmasq (3)
376.0 KiB + 20.5 KiB = 396.5 KiB at-spi2-registryd
404.0 KiB + 43.5 KiB = 447.5 KiB at-spi-bus-launcher
412.0 KiB + 47.5 KiB = 459.5 KiB sddm
420.0 KiB + 59.5 KiB = 479.5 KiB accounts-daemon
500.0 KiB + 5.5 KiB = 505.5 KiB exim4
392.0 KiB + 136.5 KiB = 528.5 KiB gvfsd
540.0 KiB + 6.5 KiB = 546.5 KiB smartd
532.0 KiB + 67.0 KiB = 599.0 KiB avahi-daemon (2)
668.0 KiB + 35.5 KiB = 703.5 KiB ntpd
448.0 KiB + 264.5 KiB = 712.5 KiB systemd-logind
680.0 KiB + 64.5 KiB = 744.5 KiB ModemManager
748.0 KiB + 7.5 KiB = 755.5 KiB rsyslogd
700.0 KiB + 77.5 KiB = 777.5 KiB kaccess
812.0 KiB + 76.5 KiB = 888.5 KiB upowerd
920.0 KiB + 7.5 KiB = 927.5 KiB dhclient
980.0 KiB + 18.5 KiB = 998.5 KiB bluetoothd
960.0 KiB + 74.5 KiB = 1.0 MiB kscreen_backend_launcher
952.0 KiB + 96.5 KiB = 1.0 MiB console-kit-daemon
1.0 MiB + 108.5 KiB = 1.1 MiB xterm
1.2 MiB + 4.5 KiB = 1.2 MiB mount.ntfs-3g
1.2 MiB + 64.5 KiB = 1.2 MiB wpa_supplicant
904.0 KiB + 374.5 KiB = 1.2 MiB gvfsd-trash
1.2 MiB + 100.5 KiB = 1.3 MiB kiod5
1.3 MiB + 80.5 KiB = 1.4 MiB akonadi_control
1.1 MiB + 257.5 KiB = 1.4 MiB su
1.4 MiB + 86.5 KiB = 1.4 MiB akonadi_migration_agent
1.3 MiB + 160.5 KiB = 1.5 MiB colord
1.4 MiB + 86.5 KiB = 1.5 MiB akonadi_contacts_resource
1.2 MiB + 350.5 KiB = 1.6 MiB cups-browsed
1.5 MiB + 98.5 KiB = 1.6 MiB akonadi_akonotes_resource
1.5 MiB + 149.5 KiB = 1.6 MiB cupsd
1.5 MiB + 104.5 KiB = 1.6 MiB akonadi_maildir_resource
1.5 MiB + 254.5 KiB = 1.7 MiB xembedsniproxy
1.7 MiB + 8.5 KiB = 1.7 MiB systemd-udevd
1.7 MiB + 103.5 KiB = 1.8 MiB akonadi_newmailnotifier_agent
1.7 MiB + 185.0 KiB = 1.9 MiB screen (2)
1.3 MiB + 687.5 KiB = 2.0 MiB klauncher
1.9 MiB + 132.5 KiB = 2.1 MiB kdeconnectd
1.9 MiB + 142.5 KiB = 2.1 MiB akonadi_ical_resource
1.6 MiB + 523.0 KiB = 2.1 MiB python3.5 (2)
1.8 MiB + 233.5 KiB = 2.1 MiB kuiserver5
2.0 MiB + 131.5 KiB = 2.1 MiB akonadi_maildispatcher_agent
2.1 MiB + 105.5 KiB = 2.2 MiB akonadi_mailfilter_agent
1.9 MiB + 370.5 KiB = 2.3 MiB kwalletd5
2.2 MiB + 151.5 KiB = 2.4 MiB korgac
2.1 MiB + 342.5 KiB = 2.4 MiB akonadi_followupreminder_agent
2.2 MiB + 203.5 KiB = 2.4 MiB htop
2.3 MiB + 158.5 KiB = 2.4 MiB systemd-journald
2.0 MiB + 438.5 KiB = 2.4 MiB gvfs-udisks2-volume-monitor
2.3 MiB + 172.5 KiB = 2.5 MiB akonadi_notes_agent
2.5 MiB + 36.5 KiB = 2.6 MiB perl
2.4 MiB + 177.5 KiB = 2.6 MiB akonadi_archivemail_agent
2.3 MiB + 298.5 KiB = 2.6 MiB udisksd
2.7 MiB + 138.5 KiB = 2.9 MiB polkitd
3.2 MiB + 91.5 KiB = 3.2 MiB vim.gtk [updated]
3.1 MiB + 123.5 KiB = 3.3 MiB kglobalaccel5
3.3 MiB + 54.5 KiB = 3.3 MiB libvirtd
3.6 MiB + 94.5 KiB = 3.7 MiB akonadi_birthdays_resource
3.6 MiB + 94.5 KiB = 3.7 MiB akonadi_indexing_agent
2.5 MiB + 1.3 MiB = 3.8 MiB systemd (3)
3.3 MiB + 600.5 KiB = 3.8 MiB kactivitymanagerd
3.8 MiB + 0.5 KiB = 3.8 MiB teamviewerd
2.9 MiB + 1.2 MiB = 4.1 MiB kded4
4.0 MiB + 256.5 KiB = 4.3 MiB polkit-kde-authentication-agent-1
2.8 MiB + 1.7 MiB = 4.5 MiB kdeinit4 (2)
4.5 MiB + 108.5 KiB = 4.6 MiB tracker-store
4.5 MiB + 462.5 KiB = 5.0 MiB hp-systray
4.8 MiB + 365.5 KiB = 5.2 MiB akonadi_sendlater_agent
5.1 MiB + 267.5 KiB = 5.4 MiB freshclam
5.3 MiB + 70.0 KiB = 5.4 MiB gnome-keyring-daemon (2)
5.1 MiB + 389.0 KiB = 5.5 MiB dbus-daemon [updated] (4)
5.7 MiB + 1.0 MiB = 6.7 MiB bash (5)
5.3 MiB + 1.5 MiB = 6.8 MiB pulseaudio
7.6 MiB + 883.5 KiB = 8.4 MiB org_kde_powerdevil
8.4 MiB + 551.5 KiB = 9.0 MiB krunner
9.5 MiB + 138.5 KiB = 9.6 MiB NetworkManager
9.5 MiB + 326.5 KiB = 9.8 MiB MusicManager
12.8 MiB + 642.5 KiB = 13.4 MiB ksmserver
12.6 MiB + 915.5 KiB = 13.5 MiB rtorrent main
12.7 MiB + 1.9 MiB = 14.6 MiB kdeinit5 (2)
16.9 MiB + 71.5 KiB = 17.0 MiB akonadiserver
9.6 MiB + 7.9 MiB = 17.5 MiB apache2 (6)
19.3 MiB + 125.5 KiB = 19.4 MiB irssi
26.0 MiB + 16.5 KiB = 26.0 MiB prx
37.6 MiB + 252.5 KiB = 37.8 MiB packagekitd
39.0 MiB + 2.2 MiB = 41.3 MiB kwin_x11
45.7 MiB + 911.0 KiB = 46.6 MiB mysqld (2)
49.8 MiB + 6.8 MiB = 56.6 MiB konsole
95.1 MiB + 11.5 MiB = 106.6 MiB telegram-desktop
156.5 MiB + 3.7 MiB = 160.2 MiB Xorg
272.6 MiB + 7.3 MiB = 279.8 MiB plasmashell
2.3 GiB + 143.6 MiB = 2.4 GiB chromium (28)
---------------------------------
3.4 GiB
=================================



Someone asked about if I have an SDD or HDD.
Where Debian is running is an SDD.

Any programs that are starting at boot is because they self-configured to autostart when they were installed.
I'll try that trick about sysctl.conf. I'm in Stretch. Is Buster already stated as stable? Or testing?
User avatar
PsySc0rpi0n
 
Posts: 108
Joined: 2012-10-24 13:54
Location: Portugal

Re: Improve memory usage in Debian

Postby theblueplll » 2019-06-22 22:48

sickpig wrote:plasma is evil twin of gnome :)


Not sure where you get this from.

Gnome on my machine uses over 1gb of ram on startup and never lets go of ram when I close programs

KDE uses 350mb
One thing that helps KDE is to not install all the bloat but even when I had all that it used very little ram.

So the op has something going on or expects to have way too much running all at once.

LXDE is ok if you want your machine too look like it is 2002.


guess it depends on how we do things, huh. My current tally arranged in my way suggest window and tab count don't tell the whole story. Currently, 105 tabs and 24 windows, 18968 MB ram, 580 MB swap. 34 days up. No issue.

WOW
What are you running for hardware I want it? LoL
theblueplll
 
Posts: 154
Joined: 2019-04-29 01:17

Re: Improve memory usage in Debian

Postby andre@home » 2019-06-23 06:38

Try Opera and compare the numbers/behavior and report back.
Why? Read this:
https://www.reddit.com/r/operabrowser/c ... om_chrome/
andre@home
 
Posts: 308
Joined: 2011-10-02 08:00

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 07:06

opera is also chromium based the RAM usage wouldn't differ much
Also, if you are browsing resource intensive websites like microsoft teams then RAM is going to deplete fast. It uses around 500 mb in chrome for just that one tab!!
Depends what 15 tabs are opened by OP, if they are as RAM magnets as teams then there goes half of his RAM.

@OP I am glad removing addons helped your cause

@theblueplll couldn't agree more, kde is definitely better than gnome but still heavy nonetheless. All the bling is going to spike RAM usage for sure.

@OP if you want to painlessly cut down on autostart apps then i have just the right app for it. let me know if you want to.

Also, ignore Wheelerof4te who keeps bragging about gnome, unlesss you want to try it. Expect more than double RAM usage on it though :)

Edit: from your apps Atom is electron based. Electron apps are notorious for abusing RAM usage as they are chromium based. If possible try to find alternative which is non electron based.
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

Postby andre@home » 2019-06-23 07:29

Do not have Chromium on my system and yet I'm on another OS, 117 tabs of Opera use only 22 MB per tab, sums up to 2.7 GB of RAM in use (from 16 GB).
So 22 MB per tab is >>20x less RAM user per tab than under Chromium? Hmmm. Can't imagine it will be so OS-dependent. So: Need to retest this under Debian.
andre@home
 
Posts: 308
Joined: 2011-10-02 08:00

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 07:57

u using opera presto or current opera?
also RAM usage per tab is site dependant, something like this forum site is not going to use much as opposed to auto video playing news sites
i use opera current version on Stretch and find RAM usage comparable to chrome for identical websites. Opera is after all chromium clone. Though they have added some convenient touches.
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

Postby Hallvor » 2019-06-23 08:05

theblueplll wrote:Not sure where you get this from.

Gnome on my machine uses over 1gb of ram on startup and never lets go of ram when I close programs

KDE uses 350mb
One thing that helps KDE is to not install all the bloat but even when I had all that it used very little ram.

So the op has something going on or expects to have way too much running all at once.

LXDE is ok if you want your machine too look like it is 2002.


Yes, KDE is efficient, especially when running KDE applications.

Compositing on, two plasmoids, Konsole, KSysGuard and Falkon web browser with adblock and 20 open and used tabs (https://kde.org/): 2GiB.

It is not a resource hog at all.
Lenovo Thinkpad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 940
Joined: 2009-04-16 18:35
Location: Norway

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 08:13

looks beautiful and sleek for sure
but anything which uses above 100mb RAM after boot scares me off
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

Postby Head_on_a_Stick » 2019-06-23 08:14

PsySc0rpi0n wrote:
Code: Select all
  2.3 GiB + 143.6 MiB =   2.4 GiB       chromium (28)

:shock:

Use firefox-esr instead.
User avatar
Head_on_a_Stick
 
Posts: 10377
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Improve memory usage in Debian

Postby PsySc0rpi0n » 2019-06-23 08:48

I don't need decrease RAM usage to close to 0MB. That's not the point. I'm just trying to find reasoning behind so huge amount of used RAM.

I'm not sure if the add-ons I removed played main role or if it was the 15 tabs open. I would bet more in the tabs open, though.

@sickpig, what kind of autostart apps are you talking about?

Most of my open tabs are forums, and random sites where I read stuff to complement commands man pages that many times I cannot understand. So I search DDG and try to see examples of commands that I need to use to complete tasks. I'm a long run Linux learner... Not sure if this is good or bad... :s
User avatar
PsySc0rpi0n
 
Posts: 108
Joined: 2012-10-24 13:54
Location: Portugal

Re: Improve memory usage in Debian

Postby Hallvor » 2019-06-23 10:17

Many open tabs (and addons!) will spike your RAM usage dramatically, but it is also a matter of the web browser used. In my own experience, Chromium has used more RAM than Firefox-esr - especially with many open tabs.

Try the following tip to reduce memory usage in Firefox (and reduce performance...):

Go to preferences. Under the tab “General”, disable the option “Use recommended performance settings” and set “Content process limit” to 2.
Disable prefetching:
Type in the URL entry field: about:config
Then: network.prefetch-next false
Lenovo Thinkpad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 940
Joined: 2009-04-16 18:35
Location: Norway

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 10:31

I was referring to the below

Code: Select all
3.2 MiB + 91.5 KiB = 3.2 MiB vim.gtk [updated]
3.1 MiB + 123.5 KiB = 3.3 MiB kglobalaccel5
3.3 MiB + 54.5 KiB = 3.3 MiB libvirtd
3.6 MiB + 94.5 KiB = 3.7 MiB akonadi_birthdays_resource
3.6 MiB + 94.5 KiB = 3.7 MiB akonadi_indexing_agent
2.5 MiB + 1.3 MiB = 3.8 MiB systemd (3)
3.3 MiB + 600.5 KiB = 3.8 MiB kactivitymanagerd
3.8 MiB + 0.5 KiB = 3.8 MiB teamviewerd
2.9 MiB + 1.2 MiB = 4.1 MiB kded4
4.0 MiB + 256.5 KiB = 4.3 MiB polkit-kde-authentication-agent-1
2.8 MiB + 1.7 MiB = 4.5 MiB kdeinit4 (2)
4.5 MiB + 108.5 KiB = 4.6 MiB tracker-store
4.5 MiB + 462.5 KiB = 5.0 MiB hp-systray
4.8 MiB + 365.5 KiB = 5.2 MiB akonadi_sendlater_agent
5.1 MiB + 267.5 KiB = 5.4 MiB freshclam
5.3 MiB + 70.0 KiB = 5.4 MiB gnome-keyring-daemon (2)
5.1 MiB + 389.0 KiB = 5.5 MiB dbus-daemon [updated] (4)
5.7 MiB + 1.0 MiB = 6.7 MiB bash (5)
5.3 MiB + 1.5 MiB = 6.8 MiB pulseaudio
7.6 MiB + 883.5 KiB = 8.4 MiB org_kde_powerdevil
8.4 MiB + 551.5 KiB = 9.0 MiB krunner
9.5 MiB + 138.5 KiB = 9.6 MiB NetworkManager
9.5 MiB + 326.5 KiB = 9.8 MiB MusicManager
12.8 MiB + 642.5 KiB = 13.4 MiB ksmserver
12.6 MiB + 915.5 KiB = 13.5 MiB rtorrent main
12.7 MiB + 1.9 MiB = 14.6 MiB kdeinit5 (2)
16.9 MiB + 71.5 KiB = 17.0 MiB akonadiserver
9.6 MiB + 7.9 MiB = 17.5 MiB apache2 (6)
19.3 MiB + 125.5 KiB = 19.4 MiB irssi
26.0 MiB + 16.5 KiB = 26.0 MiB prx
37.6 MiB + 252.5 KiB = 37.8 MiB packagekitd


You can check which ones aren't critical or essential and disable them, will save RAM but if thats not what you are after then you could try running your browser like this

Code: Select all
/opt/google/chrome/google-chrome --disable-extensions --disable-plugins


I dont have the binary path for chromium but you can substitute. I suppose chrome switches should work with chromium as well, and then see if it makes any difference in RAM usage?

if it still doesn't then the only options i can think of are either
1 change the browser
2 change the DE

or try the below in sysctl.conf

Code: Select all
vm.swappiness = 0
vm.vfs_cache_pressure=15


i have changed it to suit my needs. I of course dont use any swap. You will have to modify per your needs, tweak it suit your setup.
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

Postby PsySc0rpi0n » 2019-06-23 10:40

Isn't any of those apps critical to the system? I mean not even 'systemd', 'kded4', 'dbus eamon', 'gnome-keyring-deamon', etc???
I can try to search about the others I don't know but the above ones are not critical?
User avatar
PsySc0rpi0n
 
Posts: 108
Joined: 2012-10-24 13:54
Location: Portugal

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 10:44

no no yes of course they are, am not saying all of them are useless, I meant research which ones can be safely turned off.
There are plenty of guides out there detailing which can be safely turned off.

edit
from the ones u listed i safely turned of gnome-keyring-deamon and it has not interrupted my work flow but i m not using a DE as such so my use case might not be applicable to you. dbus is a dependency for systemd, i tried turning it off but my login crashes and i automatically re-login. So i wouldn't touch that.
'systemd', 'kded4', of course you would need.

If in doubt leave it on.
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

Postby sickpig » 2019-06-23 10:55

I use this https://github.com/oguzhaninan/Stacer/r ... tag/v1.1.0 for managing startup apps, services and much more. It makes system management a cinch. Used to change everything manually but this app is a lifesaver!
User avatar
sickpig
 
Posts: 315
Joined: 2019-01-23 10:34

PreviousNext

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable