Bug 436948 - Kwin uses 1.5GiB of ram(and 87Megs of shared mem)
Summary: Kwin uses 1.5GiB of ram(and 87Megs of shared mem)
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-x11-standalone (other bugs)
Version First Reported In: 5.20.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-11 22:39 UTC by jakubby
Modified: 2022-09-04 02:22 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Tried attaching via heaptrack to test out the heaptrack. (764.28 KB, image/png)
2021-05-12 07:54 UTC, jakubby
Details
Mem usage, it still hasn't risen to 1.5GiB, but it does slowly raise up and doesn't get freed up much. (35.07 KB, image/png)
2021-05-15 07:25 UTC, jakubby
Details
800MB (46.00 KB, image/png)
2021-05-18 13:50 UTC, jakubby
Details
Heaptrack (2.96 KB, application/zstd)
2021-05-18 13:54 UTC, jakubby
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jakubby 2021-05-11 22:39:41 UTC
SUMMARY
I have a 13 hour uptime.

STEPS TO REPRODUCE
1.Use a computer.
gtx 1060, closed source drivers nvidia-dkms, linux-zen

OBSERVED RESULT
Every kde component seems to use a "healthy" amount of ram.
But it seems like kwin_x11, got a bit chunky.

EXPECTED RESULT
I don't have to call kwin_x11 --replace every now and then, this brings it down to 200-110MiB(grows if one uses certain features etc. not everything needs to be aggressively garbage collected at all times, but 1.5GiB is excessive for 4 windows open[konsole, firefox, ksysguard, hexchat], 2 empty workspaces(out of 3))+99MiB.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.12.2-zen2-1-zen
KDE Plasma Version: 5.21.5
KDE Frameworks Version:  5.82.0
Qt Version: 5.15.2
Comment 1 David Edmundson 2021-05-11 23:23:26 UTC
There are many types of "ram" used, some harmless some not.

Please include a full screenshot from ksysguard/plasma-sytemmonitor.

Then if things look like a leak please collect a trace with heaptrack
Comment 2 jakubby 2021-05-12 07:27:27 UTC
(In reply to David Edmundson from comment #1)
> There are many types of "ram" used, some harmless some not.
> 
> Please include a full screenshot from ksysguard/plasma-sytemmonitor.
> 
> Then if things look like a leak please collect a trace with heaptrack

I have restarted kwin yesterday as I put my pc and myself to sleep.

However, I am gonna setup some kind of watchdog so I know when it is going to reaches around 1GiB again, and make it take a heaptrack once the memory stays within a 100MiB range of 1GiB for couple minutes and notify me in both cases.
Comment 3 jakubby 2021-05-12 07:54:20 UTC
Created attachment 138353 [details]
Tried attaching via heaptrack to test out the heaptrack.

But from what I can tell the file is completely empty.
Comment 4 jakubby 2021-05-15 07:25:36 UTC
Created attachment 138443 [details]
Mem usage, it still hasn't risen to 1.5GiB, but it does slowly raise up and doesn't get freed up much.

I haven't put my machine to much use in the following days.
It doesn't raise when you don't use it(and stays high when I close the windows).
The ram usage have only risen 200% from the initial value.
so from 110MiB to around 380MiB.

I do realize that mem usage raises and falls with opening and closing apps, but it seems it doesn't always reclaim all the memory afterwards.

I got a large compile job running again, ignore the cpu usage;
Comment 5 jakubby 2021-05-18 13:50:48 UTC
Created attachment 138537 [details]
800MB
Comment 6 jakubby 2021-05-18 13:54:28 UTC
Created attachment 138538 [details]
Heaptrack
Comment 7 jakubby 2021-05-18 13:54:44 UTC
(In reply to David Edmundson from comment #1)
> There are many types of "ram" used, some harmless some not.
> 
> Please include a full screenshot from ksysguard/plasma-sytemmonitor.
> 
> Then if things look like a leak please collect a trace with heaptrack

Do you need a core dump as well?
Comment 8 jakubby 2021-08-22 08:11:31 UTC
I have removed the core dump, I needed some disk space.
Comment 9 jakubby 2022-09-04 01:03:04 UTC
Fixed