Bug 435579 - Irrational memory usage ?
Summary: Irrational memory usage ?
Status: RESOLVED DUPLICATE of bug 417153
Alias: None
Product: lattedock
Classification: Plasma
Component: application (show other bugs)
Version: unspecified
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-10 14:04 UTC by Dawid
Modified: 2021-09-28 19:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid 2021-04-10 14:04:35 UTC
After using latte-dock - 1 dock, 1 panel, app is using more and more ram. It starts with around 100 - 200 MB and after a day of PC being up it gets to a 500, then with time it still increases. Informations from ksysguard:

"The process latte-dock (with pid 1789) is using approximately 581.3 MB of memory.
It is using 538.8 MB privately, 21.5 MB for pixmaps, and a further 133.9 MB that is, or could be, shared with other programs.
Dividing up the shared memory between all the processes sharing that memory we get a reduced shared memory usage of 21.1 MB. Adding that to the private and pixmap usage, we get the above mentioned total memory footprint of 581.3 MB."

Library usage: 
Private "492432 KB	[heap]"
Shared "36148 KB	/usr/lib/libLLVM-11.so"

Totals:
Pixmap	21967 KB	(Might be stored in the graphics card's memory)
Private	551708 KB	(= 22772 KB clean + 528936 KB dirty)
Shared	137144 KB	(= 136688 KB clean + 456 KB dirty)
Rss	688852 KB	(= Private + Shared)
Pss	573299 KB	(= Private + Shared/Number of Processes)
Swap	0 KB
Comment 1 Michail Vourlakos 2021-04-10 14:22:14 UTC
So why do you say that this is:

a. memory leak
b. that it is latte fault and not a specific applet that you use that requires that memory?
c. Use only Latte default layout, and provide your memory findings.

Memory leak is a scenario that ram increases endlessly, this is not the current case.

What is your Latte version? Only latest git version is considered valid.
Comment 2 Michail Vourlakos 2021-04-10 14:22:36 UTC
requires valid findings.
Comment 3 Dawid 2021-04-14 16:38:50 UTC
(In reply to Michail Vourlakos from comment #1)
> So why do you say that this is:
> 
> a. memory leak
> b. that it is latte fault and not a specific applet that you use that
> requires that memory?
> c. Use only Latte default layout, and provide your memory findings.
> 
> Memory leak is a scenario that ram increases endlessly, this is not the
> current case.
> 
> What is your Latte version? Only latest git version is considered valid.

I'm using currect version from Manjaro community, but I've tried AUR and git version as well. Problem appears when there is panel + dock. When there is only dock with default layout there is no such problem. I removed applets and memory leak was still an issue.
Comment 4 Michail Vourlakos 2021-04-14 16:51:12 UTC
(In reply to Dawid from comment #3)
> (In reply to Michail Vourlakos from comment #1)
> > So why do you say that this is:
> > 
> > a. memory leak
> > b. that it is latte fault and not a specific applet that you use that
> > requires that memory?
> > c. Use only Latte default layout, and provide your memory findings.
> > 
> > Memory leak is a scenario that ram increases endlessly, this is not the
> > current case.
> > 
> > What is your Latte version? Only latest git version is considered valid.
> 
> I'm using currect version from Manjaro community, but I've tried AUR and git
> version as well. Problem appears when there is panel + dock. When there is
> only dock with default layout there is no such problem. I removed applets
> and memory leak was still an issue.

1. did you restart Latte after you removed applets?
2. QML is not dropping its memory usage instantly, it can take plenty of time especially if your system has plenty of free RAM
3. Take not that Edit Dock... window uses around 130Mbyte. so your metrics should be provided without it.
Comment 5 Dawid 2021-04-14 17:17:09 UTC
(In reply to Michail Vourlakos from comment #4)
> (In reply to Dawid from comment #3)
> > (In reply to Michail Vourlakos from comment #1)
> > > So why do you say that this is:
> > > 
> > > a. memory leak
> > > b. that it is latte fault and not a specific applet that you use that
> > > requires that memory?
> > > c. Use only Latte default layout, and provide your memory findings.
> > > 
> > > Memory leak is a scenario that ram increases endlessly, this is not the
> > > current case.
> > > 
> > > What is your Latte version? Only latest git version is considered valid.
> > 
> > I'm using currect version from Manjaro community, but I've tried AUR and git
> > version as well. Problem appears when there is panel + dock. When there is
> > only dock with default layout there is no such problem. I removed applets
> > and memory leak was still an issue.
> 
> 1. did you restart Latte after you removed applets?
> 2. QML is not dropping its memory usage instantly, it can take plenty of
> time especially if your system has plenty of free RAM
> 3. Take not that Edit Dock... window uses around 130Mbyte. so your metrics
> should be provided without it.

Yes, I restarted it. RAM usage increases with time, after a day or two it is like 500 MB. My system has 16 GB and most of it is not used, however it's running on laptop, so it makes me worried my battery life will decrease. I'm sorry, but I don't understand "3", can you explain?
Comment 6 Michail Vourlakos 2021-04-14 17:33:32 UTC
(In reply to Dawid from comment #5)
> (In reply to Michail Vourlakos from comment #4)
> > (In reply to Dawid from comment #3)
> > > (In reply to Michail Vourlakos from comment #1)
> > > > So why do you say that this is:
> > > > 
> > > > a. memory leak
> > > > b. that it is latte fault and not a specific applet that you use that
> > > > requires that memory?
> > > > c. Use only Latte default layout, and provide your memory findings.
> > > > 
> > > > Memory leak is a scenario that ram increases endlessly, this is not the
> > > > current case.
> > > > 
> > > > What is your Latte version? Only latest git version is considered valid.
> > > 
> > > I'm using currect version from Manjaro community, but I've tried AUR and git
> > > version as well. Problem appears when there is panel + dock. When there is
> > > only dock with default layout there is no such problem. I removed applets
> > > and memory leak was still an issue.
> > 
> > 1. did you restart Latte after you removed applets?
> > 2. QML is not dropping its memory usage instantly, it can take plenty of
> > time especially if your system has plenty of free RAM
> > 3. Take not that Edit Dock... window uses around 130Mbyte. so your metrics
> > should be provided without it.
> 
> Yes, I restarted it. RAM usage increases with time, after a day or two it is
> like 500 MB. My system has 16 GB and most of it is not used, however it's
> running on laptop, so it makes me worried my battery life will decrease. I'm
> sorry, but I don't understand "3", can you explain?

when you are taking your metrics have right click a dock or panel > Edit Dock ?

That window of dock settings costs about 130Mbyte.
Comment 7 Michail Vourlakos 2021-04-14 17:37:09 UTC
4. After 500Mbyte the next day and in two days how much is the memory usage?
Comment 8 Dawid 2021-04-17 21:37:52 UTC
(In reply to Michail Vourlakos from comment #7)
> 4. After 500Mbyte the next day and in two days how much is the memory usage?
14/04 338MB
15/04 18:00 457MB
16/04 12:00 565MB
16/04 18:30 595MB
17/04 12:30 614MB


> 3. Take not that Edit Dock... window uses around 130Mbyte. so your metrics
> should be provided without it.
No, I didn't use it during checking how much RAM is being used
Comment 9 Dawid 2021-04-17 21:52:04 UTC
What I also noticed those couple of days that RAM is rising whenever I do something with dock, so opening menu, clicking wifi icon etc, but even after I finish doing that certain action, amount of RAM used by latte isn't decreasing
Comment 10 Michail Vourlakos 2021-04-18 05:55:25 UTC
Send me your layout file to check it out please
Comment 11 Michail Vourlakos 2021-04-18 05:56:17 UTC
6. How much RAM do you have in your computer?
Comment 12 Dawid 2021-04-18 08:42:45 UTC
(In reply to Michail Vourlakos from comment #10)
> Send me your layout file to check it out please

https://pastebin.com/3jKniEtp


(In reply to Michail Vourlakos from comment #11)
> 6. How much RAM do you have in your computer?

16 GB, but when latte is using more than +/- 600 MB there is visible performance drop.
Comment 13 Michail Vourlakos 2021-04-18 10:05:50 UTC
Ok, I tested your layout.

My findings are the following:
1. The issue probably is something in TopPanel and I believe is something with a hungry applet and not latte and probably how qml works

2. Let me give you some infos: in QML that Plasma is based up on when something is created it takes up some memory, when that QML-thing is deleted is not releasing that memory directly. At least this is what Plasma/Qt devs are saying. Finding memory leaks in QML I really do not have any idea what is the proper way to track them down and identify them. To test this you can do the following. Add a secodary plasma panel. Play a bit with that newly created plasma panel and delete afterwards. You will NOT notice a memory drop. Qt/Plasma devs are saying that QML based on memory criteria at some point will release that memory either because it will understand that is not used any more either because the system's memory is reaching a critical point.


I used your layout but with NO following applets which are not present in my system:

- launchpadPlasmaMod
- org.communia.apptitle
- org.kde.plasma.bigSur-inlineBatter
- org.kpple.kppleMenu
- SimplePager

I tried to reproduce the MemoryIrrational bug and reached at about 390Mbyte this is by triggering applets popups such Networks, Bluetooth, Clock, Systray and switching between different windows. The more I was using this the more the increase was lower and lower so I think it is increasing but at some point it will probably stop.

7. In your system have you reached in memory usage more than 800Mbyte?


IN ORDER TO CONFIRM THAT THIS IS NOT LATTE SPECIFIC RELATED, I added a Plasma Empty Panel and added in it the mentioned applets, Global Menu, SysTray, Bluetooth, Clock, Networks and replicated the user behavior. Same memory findings were found, plasmashell process was increasing but lower increase at each time.

I think the most hungry was the Networks applet.

Based on previous testing I am not sure that this is Latte-related or Plasma-related or QML-related.

The bug report will remain OPEN for all future users that would like to be informed about this.
Comment 14 Michail Vourlakos 2021-04-18 10:17:50 UTC
Concerning battery life be decreased because of the increased memory usage this is not valid by just searching google with: "memory usage relevant to battery life"

>>>>>
Does memory usage affect battery life?
3 Answers. The amount of data you hold in memory doesn't influence the battery life as the complete memory has to be refreshed all the time, whether you store something there or not (the memory controller doesn't know whether a part is "unused", AFAIK). By contrast, calculations do require power.
>>>>>

There are even statements that battery life is increased because hard disk is used less. So memory power consumption is not relevant at all to memory usage and hard disk usage is the one that can have influence to your battery life.
Comment 15 Michail Vourlakos 2021-09-28 19:14:15 UTC

*** This bug has been marked as a duplicate of bug 417153 ***