LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2023, 05:22 AM   #1
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Rep: Reputation: 33
Slackware64-15.0: Memory leak in kwin_x11?


Hi, I was wondering if anyone else suspects a memory leak in kwin_x11... I've tracked kwin_x11 memory use for some time using:

Code:
ps -u  -q `pidof kwin_x11`
This results in the following log (polled every hour, except when suspended):
Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  7.2  1.9 2064412 158576 ?      Sl   17:52   0:11 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  1.8  2.0 2270272 165256 ?      Sl   17:52   1:20 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  1.3  2.0 2262796 165872 ?      Sl   17:52   1:43 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  1.0  2.0 2263372 166500 ?      Sl   17:52   1:58 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.1  0.8 2341128 64352 ?       Sl   Nov22   3:33 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.3  1.0 2624312 82196 ?       Sl   Nov22   8:00 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.5  1.2 2638020 101372 ?      Sl   Nov22  13:08 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.6  1.4 2679912 119600 ?      Sl   Nov22  17:05 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.6  1.4 2680168 119892 ?      Sl   Nov22  17:20 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.6  1.4 2650388 119744 ?      Sl   Nov22  18:00 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.7  1.5 2659080 128292 ?      Sl   Nov22  21:22 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.5 2644772 121172 ?      Sl   Nov22  24:06 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.5  2.0 2873076 162784 ?      Sl   Nov22  28:38 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.9 2976480 157588 ?      Sl   Nov22  31:07 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3074340 147392 ?      Sl   Nov22  32:43 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3075364 148432 ?      Sl   Nov22  33:19 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3075608 148784 ?      Sl   Nov22  33:37 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3076140 149408 ?      Sl   Nov22  33:55 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3087844 149664 ?      Sl   Nov22  37:29 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.8 3090080 152056 ?      Sl   Nov22  38:13 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.6 3100044 134456 ?      Sl   Nov22  39:57 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  1.9 3104272 158424 ?      Rl   Nov22  41:32 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.4  2.1 3163380 169104 ?      Sl   Nov22  44:09 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.5  2.2 3175708 180168 ?      Sl   Nov22  52:04 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.5  2.3 3193956 185756 ?      Sl   Nov22  58:02 /usr/bin/kwin_x11
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
pj        2352  0.6  2.5 3215012 205608 ?      Sl   Nov22  69:08 /usr/bin/kwin_x11
The way I noticed this, was that after some time hibernation begins to fail. It happened this morning as well, and the last message in syslog reads:

Code:
elogind-daemon[1929]: Failed to suspend system. System resumed again: No space left on device
I'm using suspend-then-hibernate, and since Slackware64-15.0 I'm greeted with a new boot instead of a resume once every 5 or 10 days (and the risk that I've lost some work).

So, rather than just suspending and not hibernating, I thought it might be interesting to track memory use. I noticed that, after a couple of days, kwin_x11 comes up as the process that uses the most memory. So, does anyone else notice this? And does anyone perhaps know of a patch? A very cursory google search didn't yield anything conclusive...

Last edited by PJBrs; 11-30-2023 at 05:24 AM.
 
Old 11-30-2023, 04:40 PM   #2
jostber
Member
 
Registered: Jul 2001
Location: Skien, Norway
Distribution: Slackware Current 64-bit
Posts: 543

Rep: Reputation: 178Reputation: 178
Can you post the output of this?

Code:
kwin_x11 --version
 
Old 12-01-2023, 02:19 AM   #3
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Original Poster
Rep: Reputation: 33
Code:
$ kwin_x11 --version
Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
kwin 5.23.5
I'm assuming that the warning means nothing.
 
Old 12-01-2023, 05:03 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
If you open and close an app window a few times does that makes the memory usage go up? That's usually a good way to tell with leaky window managers.

P.S. Don't you just love progress!
Code:
$ ps -C fvwm -o vsz,rss,sz,cmd
   VSZ   RSS    SZ CMD
 16244  9808  4061 /usr/bin/fvwm
 
2 members found this post helpful.
Old 12-02-2023, 12:09 PM   #5
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Original Poster
Rep: Reputation: 33
It appears that the RSS value keeps rising... I dragged one window around, minimised / maximised it, switched back and forth between some virtual desktops, etc., (so, no new processes, just some window operations), and RSS kept slowly growing. The other two values stayed the same. Laptop is up for two days now, and kwin_x11 has the highest memory use of all processes.

I polled every second, I snipped out a couple of lines, but you get the picture. I no case does kwin_X11 RSS get lower.

Code:
~$ while true; do ps -C kwin_x11 -o vsz,rss,sz,time,cmd; sleep 1 ; done
   VSZ   RSS    SZ     TIME CMD
2931288 126088 732822 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931544 126128 732886 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931292 126288 732823 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931676 126308 732919 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2932700 126644 733175 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2932700 126768 733175 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2932700 127108 733175 00:49:11 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2933020 127276 733255 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2933020 127292 733255 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2932124 127548 733031 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2933080 127724 733270 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2932824 127840 733206 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931488 127904 732872 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931428 127908 732857 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2931172 127932 732793 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2987004 128404 746751 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2987004 128552 746751 00:49:12 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2941868 130328 735467 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2941612 132016 735403 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2941612 132544 735403 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2941556 133064 735389 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2941856 133444 735464 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935644 133460 733911 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935644 133516 733911 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935420 133528 733855 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935420 133528 733855 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935644 133584 733911 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935420 133592 733855 00:49:13 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935644 133644 733911 00:49:13 /usr/bin/kwin_x11

<snip>

   VSZ   RSS    SZ     TIME CMD
2935400 146120 733850 00:49:19 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935400 146184 733850 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935400 146236 733850 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935404 146280 733851 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935404 146320 733851 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935404 146412 733851 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935336 146484 733834 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935336 146508 733834 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935400 146544 733850 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935336 146612 733834 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935336 146644 733834 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935336 146708 733834 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935468 146740 733867 00:49:20 /usr/bin/kwin_x11
   VSZ   RSS    SZ     TIME CMD
2935400 146764 733850 00:49:21 /usr/bin/kwin_x11
Quote:
P.S. Don't you just love progress!
AAAaaargh!!! ... But I do like Plasma

Anyway, would be nice to know whether others see the same (or maybe I'm wrong and steadily rising RSS does not equal memory leak). If all else fails, I may try to compile KwinFT and see how that works.

Last edited by PJBrs; 12-02-2023 at 12:12 PM.
 
Old 12-02-2023, 05:54 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,915

Rep: Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033Reputation: 5033
The problem is that RSS of a task will increase as pages of any shared library it uses gets loaded into ram by *any* process (they get counted in each processes RSS whether that process is actively using those pages or not), so for something using a lot of shared libraries RSS increasing over time would be expected as more and more of the shared library will be in ram as new functions are called for the first time. Eventually those pages might get paged out due to page-stealing and RSS could potentially go down, but again that says little about the process itself.

If the process were leaking I'd expect sz and vsz to be increasing (with each new malloc or stack expansion).


P.S. If you want to get a proper look: /proc/$pid/maps or the front-end 'pmap' command that makes it a little more human friendly will give you more detail than you care to know.

Last edited by GazL; 12-03-2023 at 04:11 AM.
 
1 members found this post helpful.
Old 12-03-2023, 01:40 PM   #7
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Original Poster
Rep: Reputation: 33
Nevermind, I thought I saw VSZ increase, but it didn't really...

Last edited by PJBrs; 12-03-2023 at 01:41 PM.
 
Old 12-08-2023, 08:24 AM   #8
PJBrs
Member
 
Registered: Oct 2006
Distribution: Slackware 14.2 / -current
Posts: 76

Original Poster
Rep: Reputation: 33
Actually, I _do_ see kwin_x11 VSZ increase steadily over time. Not when I'm playing around with windows, but still. I've logged mem use over the past eight days. I've suspended a couple of times during that period, but never logged out. At one point, I did close and open chromium, firefox and some writer documents, but the number of running applications is mostly stable.

I'm still wondering whether anyone else has similar results. I can't imagine that I'm the only one accustomed to being logged in for weeks on end

Below the log:

Code:
%MEM    VSZ   RSS    SZ     TIME
 2.1 2867916 171068 716979 00:56:21
%MEM    VSZ   RSS    SZ     TIME
 2.1 2868236 171360 717059 00:56:34
%MEM    VSZ   RSS    SZ     TIME
 2.1 2868492 171656 717123 00:56:49
%MEM    VSZ   RSS    SZ     TIME
 2.1 2868812 171948 717203 00:57:03
%MEM    VSZ   RSS    SZ     TIME
 2.1 2869004 172244 717251 00:57:17
%MEM    VSZ   RSS    SZ     TIME
 2.1 2869388 172536 717347 00:57:31
%MEM    VSZ   RSS    SZ     TIME
 2.1 2869644 172832 717411 00:57:45
%MEM    VSZ   RSS    SZ     TIME
 2.1 2869900 173124 717475 00:57:59
%MEM    VSZ   RSS    SZ     TIME
 2.1 2870284 173416 717571 00:58:13
%MEM    VSZ   RSS    SZ     TIME
 2.1 2870540 173712 717635 00:58:27
%MEM    VSZ   RSS    SZ     TIME
 2.1 2870796 174000 717699 00:58:41
%MEM    VSZ   RSS    SZ     TIME
 2.1 2872464 175712 718116 00:58:55
%MEM    VSZ   RSS    SZ     TIME
 2.1 2873244 176504 718311 00:59:09
%MEM    VSZ   RSS    SZ     TIME
 2.2 2873652 176796 718413 00:59:23
%MEM    VSZ   RSS    SZ     TIME
 2.2 2873972 177100 718493 00:59:37
Sun Dec  3 12:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2888808 178292 722202 01:00:02
Sun Dec  3 13:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2871528 178564 717882 01:00:34
Sun Dec  3 14:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2871816 178904 717954 01:00:52
Sun Dec  3 15:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2888700 179388 722175 01:01:14
Sun Dec  3 16:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2873228 180296 718307 01:01:30
Sun Dec  3 17:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2874984 182048 718746 01:01:45
Sun Dec  3 18:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2875240 182348 718810 01:02:00
Sun Dec  3 19:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2875432 182652 718858 01:02:15
Sun Dec  3 20:22:58 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2875688 182948 718922 01:02:29
Mon Dec  4 09:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.1 2860324 169336 715081 01:05:07
Mon Dec  4 10:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.2 2870440 180856 717610 01:09:08
Mon Dec  4 11:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.4 2878972 197556 719743 01:16:52
Mon Dec  4 12:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.5 2892164 204876 723041 01:18:18
Mon Dec  4 13:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.6 2892588 208696 723147 01:19:30
Mon Dec  4 14:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.6 3184716 211224 796179 01:22:35
Mon Dec  4 15:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 2.8 3200812 230356 800203 01:30:28
Mon Dec  4 16:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.0 3213656 244836 803414 01:35:11
Mon Dec  4 17:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.2 3207260 257556 801815 01:39:09
Mon Dec  4 18:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.2 3228792 259284 807198 01:39:43
Mon Dec  4 19:10:37 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.2 3164348 262564 791087 01:41:19
Tue Dec  5 09:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.2 3209276 264396 802319 01:45:07
Tue Dec  5 10:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.3 3213624 269480 803406 01:47:42
Tue Dec  5 11:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.4 3204044 276088 801011 01:49:40
Tue Dec  5 12:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.4 3213752 272872 803438 01:51:28
Tue Dec  5 13:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.5 3218180 283864 804545 01:54:09
Tue Dec  5 14:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.6 3220416 293880 805104 01:56:27
Tue Dec  5 15:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.7 3334336 301164 833584 02:06:10
Tue Dec  5 16:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.9 3352284 319784 838071 02:16:01
Tue Dec  5 17:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3337172 321176 834293 02:16:33
Tue Dec  5 18:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3337480 321500 834370 02:16:52
Tue Dec  5 19:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3337828 321868 834457 02:17:10
Tue Dec  5 20:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3338056 322164 834514 02:17:28
Tue Dec  5 21:50:52 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3338436 322496 834609 02:17:46
Wed Dec  6 11:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 3.7 3306740 300008 826685 02:19:07
Wed Dec  6 12:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.0 3312004 325000 828001 02:20:55
Wed Dec  6 13:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.1 3318820 329212 829705 02:22:39
Wed Dec  6 14:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.2 3319296 344192 829824 02:24:17
Wed Dec  6 15:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.3 3330336 349792 832584 02:26:50
Wed Dec  6 16:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.3 3335524 351840 833881 02:28:36
Wed Dec  6 17:06:34 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.4 3348480 360504 837120 02:31:51
Thu Dec  7 10:20:44 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.2 3348088 343040 837022 02:35:01
Thu Dec  7 11:20:44 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.6 3356124 373844 839031 02:38:52
Thu Dec  7 12:20:44 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 4.7 3369352 379836 842338 02:42:50
Thu Dec  7 13:20:44 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.3 3340708 431680 835177 02:45:31
Thu Dec  7 14:20:45 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.5 3388204 444744 847051 02:50:10
Thu Dec  7 15:20:45 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.0 3410120 406956 852530 02:55:32
Thu Dec  7 16:20:50 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.2 3407736 423744 851934 03:00:43
Thu Dec  7 17:20:50 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.4 3423452 436348 855863 03:03:43
Thu Dec  7 18:20:50 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.4 3405480 436408 851370 03:04:37
Thu Dec  7 19:20:50 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.4 3406300 437276 851575 03:04:53
Fri Dec  8 15:13:42 CET 2023
%MEM    VSZ   RSS    SZ     TIME
 5.5 3463160 444768 865790 03:06:03
 
Old 12-08-2023, 09:04 AM   #9
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642Reputation: 642
Quote:
Originally Posted by PJBrs View Post
Hi, I was wondering if anyone else suspects a memory leak in kwin_x11... I've tracked kwin_x11 memory use for some time using:
.
I have suspected it several times. However, when I did examine the situation (quite long in the past), the issue was in my case rather with "kswapd" caused by some Firefox scenario or some Firefox/kwin scenario.
That's not to say there aren't leaks in kwin, probably there are such conditions. I've concretely found such situations with kmix too, but I was never able to fully track down and verify any cases of kwin issues like this.
With the first case, I struggled with this situation for quite awhile, and if my memory doesn't betray me, in some of those cases the main suspect at first was kwin, but when I tracked down and investigated the issue, it was in the end not.

I've never had these issues (except the kmix one) since I imprisoned Firefox in a pool of water, which leads me to believe that all those problems were in the end caused by Firefox. But who knows, these issues are tricky to pin down and verify. Kwin can in some case look like the culprit, but merely be reacting to a situation indirectly which isn't a problem with kwin, but rather some other issue. But then again, most of these issues I've also not had on Slackware 15, but rather when I was using Mageia.

-I guess what I'm trying to add here is that I've had similar situations.
-It's difficult to track these issues down properly
-Some issues that might at first seem like a kwin issue, is rather some other issue, and kwin is reacting to it as it should
-Some other issues might indirectly cause kwin to react in ways that it shouldn't
-It's possible that there are some conditions like this in kwin too
-I've seen similar issues with other kde software (kmix), although I was not able to track down the cause (with my setup it could very well have been caused by another issue)
-These things (kwin) probably also behave differently depending on if Xorg/Wayland is used
 
Old 12-08-2023, 09:18 AM   #10
BrunoLafleur
Member
 
Registered: Apr 2020
Location: France
Distribution: Slackware
Posts: 405

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
glibc malloc is very lazy for deallocating pools of memory. Memory can be freed with the free function after malloc or realloc but it isn't really freed because the system think it can be reused later. So the pool from which the alloc came tends to remain as long as the process is here.

For process than never ends like kwin, the virtual memory tends to never decrease.

Some alternate allocators like jemalloc tries better to relax free unused memory. The kernel has added some way to help for that (around madvise kernel calls).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cursor in Xfce after kwin_x11 --replace Gerard Lally Slackware 4 04-17-2021 02:21 PM
sddm theme replaced after switching to kwin_x11 in xfce Gerard Lally Slackware 18 11-13-2019 12:38 PM
[SOLVED] Memory leak: How risky not to free allocated memory. kaz2100 Linux - General 1 12-24-2008 12:00 AM
Inactive memory issue, Freebsd (memory leak?) JasperB *BSD 7 08-12-2008 03:19 AM
Memory Leak when using memory debugging C program on SuSE SLES8 babalina Linux - Distributions 0 10-06-2003 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration