Keep it light, make it lighter
Open, Needs TriagePublic

Description

Motivation

I often come across this idea that the KDE environment is heavy on resources and in recent years I think that's become a matter of presentation.

As an example of this idea, I've noticed that default KDE installations on Ubuntu and Fedora will use around 1GB of RAM when you login.
However, minimal installations on Debian, Ubuntu and Fedora will go as low as 500MB of RAM.

I think a lot of people will agree that 500MB of RAM is a respectable result and would love to see the KDE project recognized for this capability more often.

Plan

Achieving this goal would involve focusing on the following

  • Identify the most memory consuming features
  • Discuss whether improving them is feasible and any possible tradeoffs
  • Revise how to make them easy to configure (in on/off/tradeoff situations)
  • Test with some regularity to confirm we don't get unexpected results / issues

Community

To help achieve this goal we should continue to use KDE Neon as a way to show the world what can be achieved.
Of course, we would also need help from Linux distributions and they could use Neon as their guide.

Risks and needs

The risks would be lack of interest and lack of developer time.
If distributions decide that enabling a certain feature suits their goals better part of the work done here might go to waste.
From the developer's side, they could have more pressing matters and this kind of optimizations might become secondary.

The main need for this goal is developer time.

Champion

I'm Juan Pablo Tettamanti and I'd like to help KDE be recognized not only for it's beauty and customizability but also because of it's outstanding efficiency.
On a day to day basis I work as a programmer and I heard anyone could help shape the future of KDE so here I am.

Interest

jptettamanti updated the task description. (Show Details)
niccolove added a subscriber: niccolove.EditedJun 30 2022, 6:36 PM

The goal is interesting, but I think the plan is not adequate. File indexing, as an example, is not a feature that you can simply remove or disable by default. It is something that users rightfully expect out of their operating system.

The goal is interesting, but I think the plan is not adequate. File indexing, as an example, is not a feature that you can simply remove or disable by default. It is something that users rightfully expect out of their operating system.

Baloo is known on Reddit, and other places, for being buggy. Maybe, an option could be added to control how many resources it can use.

Regards.

I doubt that's feasible; a better approach would be to actually investigate the shortcomings of Baloo and improve it as much as possible. Reddit experience is very anectodal, and some better profiling could be needed to pinpoint the issues.

jptettamanti updated the task description. (Show Details)Jul 3 2022, 9:51 PM
jptettamanti updated the task description. (Show Details)

This goal would conflict with "KDE For All: Boosting Accessibility for Plasma and Apps" as improving accessibility will inevitably make KDE heavier.

As a counterpoint to KDE's light weight, on my system right now, plasmashell alone is eating 584 megabytes, and I've seen over 1 gigabyte in the past. Googling plasmashell memory usage turns up countless reports of memory leaking. From what I've heard, you can try removing applets and seeing if the leak stops, but this is involved, takes a long time to know for sure that plasmashell doesn't leak, and it's difficult to restore your original configuration. I tried using Heaptrack in the past, but IIRC the call stack of the leaked allocations pointed to the internals of the QV4 JavaScript engine, rather than the QML code triggering those allocations.

In the case of Baloo, I suspect it developed a reputation for heavy weight because it uses LMDB, which allocates 256 gigabytes of virtual address space (though it's not actually used), inflates disk space indefinitely when a read transaction is held open, never reduces space afterwards (by design of LMDB, but perhaps can be avoided by not holding transactions open, and "vacuuming" the database regularly and/or when disabling file indexing or removing indexed directories), and corrupts randomly frequently (possibly due to threading errors in baloo_file? btrfs non-COW?).

Multiple people (including myself) have run into corrupt databases causing Baloo to crash (https://bugs.kde.org/show_bug.cgi?id=434926). And in the past (years ago) I've also run into Baloo burning a full CPU core, possibly due to a corrupt database, but I cannot reproduce or debug it anymore.

I think simply improving ram usage might be hard to archieve without sacrifaces, and it could also make progress harder. The difference between 500MB and 1GB is not that much, when for example a web browser itself can take 1GB with one webpage open, and todays hardware is kind of prepared for that (specially If we are thinking about future).

rwbarat added a subscriber: rwbarat.Aug 5 2022, 8:42 AM
adam added a subscriber: adam.Aug 21 2022, 6:39 PM

Notes from refinement session:

Seeing as the https://phabricator.kde.org/T15676 Goal proposal is also talking about using as little resources as possible for sustainability’s sake, could this proposal be merged with that one? Alone this could be too small for a Goal perhaps.

adam added a comment.Aug 21 2022, 6:50 PM

The voting starts in a week, if you plan to update the proposal it is best to do it soon.

adam added a comment.Aug 27 2022, 12:29 PM

As the author did not act on the comments here, I will not move this proposal to the voting stage.

File indexing, as an example, is not a feature that you can simply remove or disable by default. It is something that users rightfully expect out of their operating system.

I don't know where you get this data from (any source? a survey maybe?), but for me it's doubtful. From my system I expect to give me a choice if I want to use a feature or not.

I doubt that's feasible; a better approach would be to actually investigate the shortcomings of Baloo and improve it as much as possible. Reddit experience is very anectodal, and some better profiling could be needed to pinpoint the issues.

I think that in the meantime it would be better to let people disable Baloo and not torture them with buggy behaviour.

It's late but I wanted to say that I like the original poster idea. I used to check my e-mail with KMail which had to start akonadi which took about 800 MB of my RAM. Now I use Claws Mail which takes only 50 MB, is way snappier and doesn't hang like KMail. I don't understand why KDE Software has to use so much RAM, and have all those nonessential features (like e.g Baloo or Activities) running mandatory in the background.