Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Improve memory usage in Debian

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Improve memory usage in Debian

#61 Post by Hallvor »

Deb-fan wrote:Switching to a lighter desktop (or window manager) is a easy and straightforward way to save a huge chunk of system resources but is dependent on a person preferences. Would advise trying any that look interesting to you in live session isos or vm to see if it's something you'd want to do or pursue.
Do you have benchmarks to back up that claim? I posted a link that showed that the difference between KDE and XFCE in real use was less than 100 megabytes.* You may want to call that a huge chunk of system resources, but on most systems, including OP's system, I'd call that negligible.

* KDE was also running more advanced applications.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Improve memory usage in Debian

#62 Post by CwF »

Waste not, Want not.

Code: Select all

dom0@computer:~$ uptime
 10:42:23 up 43 days, 13:51,  3 users,  load average: 1.73, 3.59, 4.46
dom0@computer:~$ uptime
 09:05:32 up 44 days, 12:15,  3 users,  load average: 1.39, 1.36, 1.36
dom0@computer:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:            31G         19G        378M        479M         11G         11G
Swap:          7.6G        874M        6.8G

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Improve memory usage in Debian

#63 Post by Hallvor »

Goodness.. What are you running?
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

CwF
Global Moderator
Global Moderator
Posts: 2625
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 190 times

Re: Improve memory usage in Debian

#64 Post by CwF »

Hallvor wrote:Goodness.. What are you running?
Apparently everything! No, not really. Version 2 of the everything box, still a failure, but really close.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#65 Post by Deb-fan »

Can only go by stats others post about whichever desktop(s) Last time I'd messed with Gnome, was v 2.4. Mainly think windows managers are the bomb, for me openbox and the 2 Debian installs on my crusty ole lappy both weigh in at under 100mbs-ram(4gbs total) . You're right though with 16gbs any desktop should be negligible. Not that am saying anything bad about all the gnu/Linux desktop choices either. Plenty of amazing stuff to choose from. Wondering if OP was just misreading their memory usage.

There are plenty of credible examples of how to go about optimizing a gnu/nix operating system and the results/impact that doing so can have on resource overhead. Stand by some of the lowest hanging fruit in that is choice of desktop(windows manager) For people whose goal is making it lighter. Well and again someone tweaking their choosen desktop/Os, started out with gnu/Linux Mint 10 (Gnone 2.4) out of box used 270mbs-ram, after tweaking was down to like 124mbs. Same desktop, same Os, 54% reduction in memory usage. Not to mention lower cpu loads, ran faster, smoother and cooler, more stable and with a bunch of unused process disabled has to equal somewhat more secure. Yep would class that example as a huge improvement.

Also, lmao CwF, damn man. :)
Last edited by Deb-fan on 2019-07-02 18:13, edited 2 times in total.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
piperdan
Posts: 35
Joined: 2018-07-29 01:57
Location: USA
Has thanked: 1 time
Been thanked: 4 times

Re: Improve memory usage in Debian

#66 Post by piperdan »

Just for kicks, I did a quick comparison of how my Debian (Buster) Gnome install with nothing running except a terminal emulator in the desktop and checked the memory usage compared with Fedora 30, Solus-Gnome, OpenSUSE-Gnome (Leap), and Manjaro-Gnome.

Debian-Buster: 750 to 800 MB
Fedora 30: 1100 to 1200 MB
OpenSUSE Leap 15: over 1200 MB
Solus-Gnome: The lightest at just under 700 MB.
Manjaro-Gnome: 1000 - 1100 MB.

Disclaimer - Only Debian was on bare metal. The rest were virtual (in Boxes)

This was all on an old Dell Latitude E6430 with 16 GB RAM and a 250 GB SSD. It's a beast, but runs great on Debian, and no problems whatsoever with Gnome.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#67 Post by Deb-fan »

^ Hey thanks for that. Cool!
Most powerful FREE tech-support tool on the planet * HERE. *

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#68 Post by Deb-fan »

Dang it read the 1st page, then replied being bored and a dork went ahead and read through it all. So ended up with a few more comments. Think lowering swappiness is an essential tweak but agree with the person which said don't set it at zero. Have always seen (and set it to) vm.swappiness=10 as recommended for desktop gnu/nix. The default is 60, way too high imo and with an Ssd people want to minimize disk writes anyway. That's a whole subject itself. Optimizing gnu/nix for ssd's. Something you may want to take up with Google too.

Also agree when that same person advised not troubling too much about disabling startup services/daemons. Particularly if someone doesn't know about it. Example: On a single user system I don't need a display manager to automatically login my user and launch a graphical session. So I disabled lightdm( one display manager) on one OS/install for the heck of it. However doing so saves all of 8mbs-ram and speeds boot by some miniscule amount of time. The amount of ram/boot time you're likely to save and with 16gbs-ram is moot.

Link to the how to auto-login + startx.

Link fixed damn you android!!
Last edited by Deb-fan on 2019-07-02 22:40, edited 5 times in total.
Most powerful FREE tech-support tool on the planet * HERE. *

Wheelerof4te
Posts: 1454
Joined: 2015-08-30 20:14

Re: Improve memory usage in Debian

#69 Post by Wheelerof4te »

Keep in mind that GNOME's System Monitor calculates both cached and used memory and displays it as one metric. So, it's a bit inaccurate and actual memory footprint may be lower. My gnome-shell process is using 95 MB of RAM, Chromium with 2 open tabs chomps 828 MB, while System monitor reports total 2.1 GB.
For some reason, gnome-documents is active and chomps whopping 28 MB RAM. I don't even use it, nor did I open it once, lol.
EDIT: I just removed it safely, so no big deal. Still, those 28 MB were too much for a stupid tracker app.

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#70 Post by Deb-fan »

^ Agree with you again but people who are compulsive optimizers are gonna know what they need/don't. Won't take the meta-package route, will install the desktop components they want and what and how to safely disable and remove bloat on a favorite DE/etc. Aka: bloat avoidance and stripping. :)
Most powerful FREE tech-support tool on the planet * HERE. *

theblueplll
Posts: 154
Joined: 2019-04-29 01:17
Been thanked: 2 times

Re: Improve memory usage in Debian

#71 Post by theblueplll »

Deb-fan wrote:^ Agree with you again but people who are compulsive optimizers are gonna know what they need/don't. Won't take the meta-package route, will install the desktop components they want and what and how to safely disable and remove bloat on a favorite DE/etc. Aka: bloat avoidance and stripping. :)
I am pretty obssesive about avoiding bloat I have a big problem with and os or device forcing things on me which is one of the reasons I love Linux so much.
I guess it comes from using windows for all those years and being pissed that I couldn't disable something because something I didn't even use needed it or something I couldn't uninstall because ya know ms said so that I never used.

So now i have the freedom to do so as I please(well sort of some things need to be left alone) so I get out of control with it.

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

#72 Post by sickpig »

Hallvor wrote:* KDE was also running more advanced applications.
what's are these "more advanced applications" which openbox cant run under Debian?

jibberjabber
Posts: 162
Joined: 2016-01-10 16:58

Re: Improve memory usage in Debian

#73 Post by jibberjabber »

Hallvor wrote:
Deb-fan wrote:Switching to a lighter desktop (or window manager) is a easy and straightforward way to save a huge chunk of system resources but is dependent on a person preferences. Would advise trying any that look interesting to you in live session isos or vm to see if it's something you'd want to do or pursue.
Do you have benchmarks to back up that claim? I posted a link that showed that the difference between KDE and XFCE in real use was less than 100 megabytes.* You may want to call that a huge chunk of system resources, but on most systems, including OP's system, I'd call that negligible.

* KDE was also running more advanced applications.
Where does he say anything about the more advanced applications not running on OpenBox ? Where does he even mention OpenBox ?
The comparison is being made between KDE and XFCE.
=======
sickpig wrote:yes, my responses were childish, I shall refrain from such behaviour. I agree our forum is no place for non-sense. My apologies.
Talk is cheap, and a empty apology is , well "empty".
written by HelpBot#8453
Alias jibberjabber
I am sorry, my english is not that good, and I sometimes have other problems,so my response might not be perfect.
N5RLX > "Jibber jabber ,all day and all night, jibber jabber jibber jabber"

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

#74 Post by sickpig »

well if openbox can run them then I would like to know what they are so I can do my own memory consumption comparison rather than being dependant on benchmarks. Especially benchmarks posted on reddit aren't too trustworthy for me.

I should probably have framed the question better and asked for the list of "advanced applications" rather than assuming that it meant they wont run on openbox.

Possibly if an application inherently requires compositing to function then of course it will not work on openbox by default.

vbrummond
Posts: 4432
Joined: 2010-03-02 01:42

Re: Improve memory usage in Debian

#75 Post by vbrummond »

I think the majority of this are caches on my iMac. If I start a few vm nothing slows down, and compressed memory is great. I miss i386 Linux. Running on under 100mb of ram with KDE 3.5. All of that ram was for applications.
Image
Always on Debian Testing

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#76 Post by Deb-fan »

Lol o course thread has jumped the tracks(myself contributing to.) :p

@Sickpig see such, just remembered from #! (Crunchbang gnu/linux) days. Think you'd have liked it. By advanced applications think that Halloran meant KDE is more feature rich than Xfce. Though also maintaining much can be done to tweak all hades out of Kde/Gnome/Xfce. Less than 100mbs difference between KDE VS Xfce4, guessing that instance of Xfce must've been Uber bloated. Meta-package (recommend/suggests/kitchen-sink setup?) OK shutting it.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
sickpig
Posts: 589
Joined: 2019-01-23 10:34

Re: Improve memory usage in Debian

#77 Post by sickpig »

Deb-fan thanks for the link, I dont need compositing for anything as such yet. But good to know in case i come across something which absolutely will not work without it.

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2020
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 138 times
Been thanked: 204 times

Re: Improve memory usage in Debian

#78 Post by Hallvor »

Deb-fan wrote:Less than 100mbs difference between KDE VS Xfce4, guessing that instance of Xfce must've been Uber bloated. Meta-package (recommend/suggests/kitchen-sink setup?) OK shutting it.
This was the stock Debian 9 install, so it can be argued that they are both bloated. I was unable to find out if compositing was disabled in KDE in the benchmark, as it is enabled by default. Anyway, compositing off on both desktop environments would probably be a good idea for a fair comparison.

As for advanced applications, it had of course nothing to do with compositing, but features. (English is not my native language, so what can you expect.. ;)) The benchmark showed RAM usage with Firefox, the terminal and the file manager. My point was that Konsole is more feature rich than the terminal of XFCE, and Dolphin is more feature rich than Thunar, making the differenve of RAM comsumption somewhat less impressive.

I was an XFCE user for a year or two myself, but I did have a soft spot for KDE applications, and KDE (3.5) was rumored to be bloated even back then. But I found that XFCE actually used more RAM than KDE when using KDE applications.

Fresh benchmarks for stock Buster installs would be nice, if anyone is up for the task.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: Improve memory usage in Debian

#79 Post by Deb-fan »

^ DEFINITELY Hallvor( about to start a dorkish thread on the topic, why not ... it's what forums are for right ?)

@Sickpig welcome dude. :)

More babblings folks, forgive me in advance. Think it's one of the many great things about gnu/Linux. All supposed to be interoperable/modular. Yeah you can use Kde apps in Gnome and vice versa. Just like someone can use those in openbox-etc. Though you're going to pull in a crapton of bloat packages along with, esp if someone were to have apt/itude-whatever set to also install recommends/suggests. It's one of my pet peeves too. I consider any system resources whether it be mem/disk/cpu that's not being used for a purpose I find useful or enjoyable to be wasted. Also am compelled to tweak all hades out of any OS used or applications on it where possible. ie: Firefox stock, is still a system resource sucking pigdog vs some tweaks applied. There's a night and day difference.

While bytching, also always been aggravated by distro's that put out versions with different GUI (like Xfce) but the underlying operating system is still the same. That's not aimed at Debian, I <heart> Debian. I still really like Linux Mint from afar but they're gnome centric (used a ton of gnome packages), always have been. So a ton of stuff has to be trimmed out of the xfce edition to get it under control. End result is someone may have Xfce and it'll be somewhat lighter on resources but not much difference in what's under the hood.

Note: Recently played with several of LM's releases, Cinnamon/Mate/LMDE3 and all of them were very reasonable and good OS's imo out-of-box but esp so after applying some tweakage. Just don't want to defame LM.

Basically always have, always will like getting the most out my equipment. If I can find a feature rich app/util that does a great job for it's function but only has a handful of depends-etc. I can't see any reason to use something that's bloated and pulls in a kitchen sink to the OS. Like you/Hallvor said with avg system specs these days, systems have plenty to spare anyway. It's down to personal preferences I guess. For me ... minimal Debian netinstall(s) are my preference and can't see that changing. Only time I've installed a full stock Debian OS was by accident, I'd hit the wrong thing in the installer. Looked at it for all of 12secs thought, nice. Overwrote the install and got what I was going for setup. :D Sorry folks, haven't done the gnu/Linux forum thing in quite awhile. So am typing-babbling my arse off.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
PsySc0rpi0n
Posts: 321
Joined: 2012-10-24 13:54
Location: Bitcoin World
Has thanked: 8 times
Been thanked: 1 time

Re: Improve memory usage in Debian

#80 Post by PsySc0rpi0n »

Hello peeps.

I stopped getting notifications on this thread and had no idea the thread blew off to the sky in replies... :)

Anyway, about my original reason for creating this thread, I think the culprit was obvious. Google Chrome is the one.
The steps I took to make this less "painful" to RAM was only 3 steps.

1 - Decreasing number of tabs open (probably the main contributor).
2 - Uninstall some Google apps (so called add ons??) I think I could live without.
3 - Install add on "noscript" and allow only the critical java stuff needed to load and use sites. Apparently Java/JS/etc is also an heavy RAM consumer.

My first (or early posts) claimed that I was having issues with RAM where out of 16Gb RAM, about 12Gb or more were being used. I was using a few applications at the same time but probably I didn't need to have them all opened at the same time.

As of now, 8 tabs open, Telegram and Discord, irssi (inside screen), rtorrent (inside screen) and only 3.35Gb of RAM used.

I tried to change swappiness setting and one other that was inside the same file but now I want to change it back but I'm not sure the previous values.
I remember I added vm.swappiness=50 to /etc/sysctl.conf file but there is another setting there that I'm not sure if I added it myself or if it was already there which is vm.vfs_cache_pressure=200.

I read that default values are 60 and 100 respectively. Is this accurate? Or can I just delete that 2nd setting and leave just the other as vm.swappiness=10???

However, if I run:

Code: Select all

sudo swapon --show
I get the following output:

Code: Select all

NAME      TYPE      SIZE USED PRIO
/dev/sda5 partition 4,9G   0B   -2
I was expecting some used value because vm.swappiness=50, so wasn't it expected to have some SWAP space used?

Post Reply