You are not logged in.

#1 2018-09-13 15:37:06

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Huge memory leak on linux kernel 4.18

I am facing huge memory leak issues on the linux kernel since the past few weeks. Within hours my ram gets filled. I have attached the output of /proc/meminfo right after boot and after a while ( 4 hours)

MemTotal:        3939328 kB
MemFree:          957132 kB
MemAvailable:    2367416 kB
Buffers:           42372 kB
Cached:          1677776 kB
SwapCached:            0 kB
Active:          1197604 kB
Inactive:        1125964 kB
Active(anon):     603932 kB
Inactive(anon):   167916 kB
Active(file):     593672 kB
Inactive(file):   958048 kB
Unevictable:          64 kB
Mlocked:              64 kB
SwapTotal:       4194296 kB
SwapFree:        4194296 kB
Dirty:               136 kB
Writeback:             0 kB
AnonPages:        603540 kB
Mapped:           299804 kB
Shmem:            168432 kB
Slab:             188544 kB
SReclaimable:     134880 kB
SUnreclaim:        53664 kB
KernelStack:        5936 kB
PageTables:        19464 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     6163960 kB
Committed_AS:    3288720 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:      2048 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      179600 kB
DirectMap2M:     3911680 kB
DirectMap1G:     1048576 kB

after

MemTotal:        3939328 kB
MemFree:          222564 kB
MemAvailable:    1101564 kB
Buffers:           47576 kB
Cached:          1164596 kB
SwapCached:           72 kB
Active:           886748 kB
Inactive:         928276 kB
Active(anon):     350172 kB
Inactive(anon):   426388 kB
Active(file):     536576 kB
Inactive(file):   501888 kB
Unevictable:          64 kB
Mlocked:              64 kB
SwapTotal:       4194296 kB
SwapFree:        4193516 kB
Dirty:               720 kB
Writeback:             0 kB
AnonPages:        602852 kB
Mapped:           288720 kB
Shmem:            173704 kB
Slab:             172604 kB
SReclaimable:      98928 kB
SUnreclaim:        73676 kB
KernelStack:        5952 kB
PageTables:        19472 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     6163960 kB
Committed_AS:    3289656 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:      2048 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      275856 kB
DirectMap2M:     3815424 kB
DirectMap1G:     1048576 kB

here is the output of top after leak

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
  989 sidd      20   0 1192020 194804  72940 S   0.0   4.9   0:31.35 slack
  732 sidd      20   0 1508000 144280  72116 S   0.0   3.7   0:53.28 slack
  949 sidd      20   0 1047392 110088  64340 S   0.0   2.8   0:26.71 slack
  425 root      20   0 1052116  83936  59080 S   6.2   2.1   2:08.38 Xorg
  478 mysql     20   0  866496  80944  16452 S   0.0   2.1   0:18.62 mysqld
  936 sidd      20   0  374824  64360  44380 S   0.0   1.6   0:04.60 slack
  707 sidd      20   0  407312  55600  15256 S   0.0   1.4   2:37.70 awesome
  730 sidd      20   0  673496  51088  37604 S   0.0   1.3   0:00.81 kdeconnect-indi
  769 sidd      20   0  663080  49720  36716 S   0.0   1.3   0:02.95 kdeconnectd
  870 sidd      20   0  299496  40120  27880 S   0.0   1.0   0:00.06 slack
 9533 sidd      20   0  612936  39916  24644 S   0.0   1.0   0:06.95 xfce4-terminal
  714 sidd      20   0 1276620  33260  17724 S   0.0   0.8   0:07.21 Thunar
  771 sidd      20   0  502288  31804  18920 S   0.0   0.8   0:08.03 nm-applet
  400 root      20   0  202616  25536  18460 S   0.0   0.6   0:01.01 httpd
  788 sidd      20   0  355560  25124  12680 S   0.0   0.6   0:01.79 xfce4-power-man
  716 sidd      20   0  387172  25040  14396 S   0.0   0.6   0:01.25 xfdesktop
  770 sidd      20   0  411728  24028  12420 S   0.0   0.6   0:01.37 xfce4-notifyd
  418 postgres  20   0  234972  22648  21268 S   0.0   0.6   0:00.14 postgres
  490 polkitd   20   0 2001284  20876  14848 S   0.0   0.5   0:00.66 polkitd
  775 sidd      20   0  374612  20476   9720 S   0.0   0.5   0:01.58 light-locker
  753 sidd      20   0  292936  20272   9692 S   0.0   0.5   0:00.31 polkit-gnome-au
  736 sidd      20   0  579012  18236   8544 S   0.0   0.5   0:00.49 xfce4-volumed-p
  390 root      20   0  814912  17636  14316 S   0.0   0.4   0:11.18 NetworkManager
  731 sidd      20   0  180152  17036   7632 S   0.0   0.4   0:57.91 compton
  249 root      20   0   89712  15352  14544 S   0.0   0.4   0:00.97 systemd-journal
  719 sidd      20   0  332828  15280  12332 S   0.0   0.4   0:00.38 xfsettingsd
  711 sidd      20   0  149712  15168  12140 S   0.0   0.4   0:01.02 xfce4-panel
  676 sidd      20   0  293824  14264  12052 S   0.0   0.4   0:00.25 xfce4-session
  498 http      20   0  207380  12904   5796 S   0.0   0.3   0:00.06 httpd
  499 http      20   0  207380  12904   5796 S   0.0   0.3   0:00.00 httpd
  500 http      20   0  207380  12904   5796 S   0.0   0.3   0:00.00 httpd
  501 http      20   0  207380  12708   5600 S   0.0   0.3   0:00.00 httpd
  502 http      20   0  207380  12680   5572 S   0.0   0.3   0:00.00 httpd
  764 sidd       9 -11  866940  11604   8184 S   0.0   0.3   0:25.73 pulseaudio
 3593 root      20   0  444768  11248   8716 S   0.0   0.3   0:02.19 udisksd
 3590 sidd      20   0  310316  11180   9320 S   0.0   0.3   0:00.27 gvfs-udisks2-vo
  261 root      20   0   76260   9012   5684 S   0.0   0.2   0:01.47 systemd-udevd
    1 root      20   0  220192   8748   6744 S   0.0   0.2   0:02.17 systemd
  801 root      20   0  289152   8384   6832 S   0.0   0.2   0:01.07 upowerd
  564 postgres  20   0  234972   8028   6632 S   0.0   0.2   0:00.32 postgres
  628 sidd      20   0   64764   8008   6712 S   0.0   0.2   0:00.10 systemd
 3607 sidd      20   0  335708   7308   5164 S   0.0   0.2   0:00.24 gvfsd-trash
  619 root      20   0  229448   7260   6244 S   0.0   0.2   0:00.03 lightdm
  408 root      20   0  333548   6844   5688 S   0.0   0.2   0:00.10 lightdm
  831 sidd      20   0  280316   6484   5612 S   0.0   0.2   0:00.04 gsettings-helpe
 3613 sidd      20   0  410588   6384   5176 S   0.0   0.2   0:00.05 gvfsd-network
 3618 sidd      20   0  345808   6372   5448 S   0.0   0.2   0:00.10 gvfsd-dnssd
  385 root      20   0   57048   6104   5380 S   0.0   0.2   0:00.32 systemd-logind
  639 sidd      20   0  254744   6076   5148 S   0.0   0.2   0:00.08 gnome-keyring-d
  565 postgres  20   0  235388   5960   4360 S   0.0   0.2   0:00.15 postgres
  739 sidd      20   0  258476   5828   4908 S   0.0   0.1   0:00.05 gvfsd
  489 root      20   0   24708   5616   4752 S   0.0   0.1   0:02.22 wpa_supplicant
 9538 sidd      20   0   12928   5544   3616 S   0.0   0.1   0:00.47 bash
  745 sidd      20   0  395368   5520   4836 S   0.0   0.1   0:00.01 gvfsd-fuse
  761 sidd      20   0  196160   5428   4664 S   0.0   0.1   0:00.35 at-spi2-registr
  754 sidd      20   0  324368   5396   4768 S   0.0   0.1   0:00.00 at-spi-bus-laun
  698 sidd      20   0   36824   5132   4292 S   0.0   0.1   0:00.12 xfconfd
  793 sidd      20   0  167300   5040   4340 S   0.0   0.1   0:00.03 dconf-service
  387 dbus      20   0   21272   4588   3452 S   0.0   0.1   0:05.40 dbus-daemon
  669 sidd      20   0   20888   4444   3540 S   0.0   0.1   0:00.38 dbus-daemon
 3624 sidd      20   0  176864   4304   3920 S   0.0   0.1   0:00.01 gvfsd-metadata
  567 postgres  20   0  235272   4260   2760 S   0.0   0.1   0:00.01 postgres
  417 ntp       20   0   84952   4180   3612 S   0.0   0.1   0:01.81 ntpd
  383 systemd+  20   0  137360   4020   3364 S   0.0   0.1   0:00.43 systemd-timesyn
  759 sidd      20   0   20432   3868   3464 S   0.0   0.1   0:00.05 dbus-daemon
  563 postgres  20   0  234972   3384   2012 S   0.0   0.1   0:00.39 postgres
  562 postgres  20   0  234972   3320   1948 S   0.0   0.1   0:00.00 postgres
  642 sidd      20   0   11456   3268   2808 S   0.0   0.1   0:00.05 sh
  405 root      20   0   20164   3244   2684 S   0.0   0.1   0:00.02 sshd
  844 sidd      20   0   11456   3024   2692 S   0.0   0.1   0:00.00 bash
10678 sidd      20   0   22500   3024   2652 R   6.2   0.1   0:00.01 top
  776 rtkit     21   1  164792   2712   2480 S   0.0   0.1   0:00.30 rtkit-daemon
  566 postgres  20   0   89896   2680   1308 S   0.0   0.1   0:00.18 postgres
  854 sidd      20   0   18328   2300   2064 S   0.0   0.1   0:02.12 unclutter
  630 sidd      20   0  262332   2108     40 S   0.0   0.1   0:00.00 (sd-pam)
  704 sidd      20   0  163148   1356   1188 S   0.0   0.0   0:00.78 gpg-agent
  259 root      20   0   82336   1344   1204 S   0.0   0.0   0:00.00 lvmetad
  701 sidd      20   0    7496    340      0 S   0.0   0.0   0:00.00 ssh-agent
    2 root      20   0       0      0      0 S   0.0   0.0   0:00.01 kthreadd
    3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp
    4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp
    6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0H-kblockd
    8 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq
    9 root      20   0       0      0      0 S   0.0   0.0   0:00.73 ksoftirqd/0
   10 root      -2   0       0      0      0 I   0.0   0.0   0:08.91 rcu_preempt
   11 root      -2   0       0      0      0 I   0.0   0.0   0:00.03 rcu_sched
   12 root      -2   0       0      0      0 I   0.0   0.0   0:00.00 rcu_bh
   13 root      -2   0       0      0      0 S   0.0   0.0   0:01.06 rcuc/0
   14 root      -2   0       0      0      0 S   0.0   0.0   0:00.00 rcub/0
   15 root      rt   0       0      0      0 S   0.0   0.0   0:00.02 migration/0
   16 root      rt   0       0      0      0 S   0.0   0.0   0:00.06 watchdog/0
   17 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/0
   18 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/1
   19 root      rt   0       0      0      0 S   0.0   0.0   0:00.06 watchdog/1
   20 root      rt   0       0      0      0 S   0.0   0.0   0:00.03 migration/1
   21 root      -2   0       0      0      0 S   0.0   0.0   0:01.34 rcuc/1
   22 root      20   0       0      0      0 S   0.0   0.0   0:01.04 ksoftirqd/1
   24 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/1:0H-kblockd
   25 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/2
   26 root      rt   0       0      0      0 S   0.0   0.0   0:00.07 watchdog/2
   27 root      rt   0       0      0      0 S   0.0   0.0   0:00.02 migration/2
   28 root      -2   0       0      0      0 S   0.0   0.0   0:01.09 rcuc/2
   29 root      20   0       0      0      0 S   0.0   0.0   0:00.73 ksoftirqd/2
   31 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/2:0H-kblockd
   32 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/3
   33 root      rt   0       0      0      0 S   0.0   0.0   0:00.06 watchdog/3
   34 root      rt   0       0      0      0 S   0.0   0.0   0:00.02 migration/3
   35 root      -2   0       0      0      0 S   0.0   0.0   0:03.23 rcuc/3
   36 root      20   0       0      0      0 S   0.0   0.0   0:03.93 ksoftirqd/3
   38 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/3:0H-kblockd
   39 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kdevtmpfs
   40 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 netns
   41 root      20   0       0      0      0 S   0.0   0.0   0:00.00 rcu_tasks_kthre
   42 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kauditd
   46 root      20   0       0      0      0 S   0.0   0.0   0:00.01 khungtaskd
   47 root      20   0       0      0      0 S   0.0   0.0   0:00.00 oom_reaper
   48 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 writeback
   49 root      20   0       0      0      0 S   0.0   0.0   0:00.20 kcompactd0
   50 root      25   5       0      0      0 S   0.0   0.0   0:00.00 ksmd
   51 root      39  19       0      0      0 S   0.0   0.0   0:00.50 khugepaged
   52 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 crypto
   53 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kintegrityd
   54 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kblockd
   56 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 edac-poller
   57 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 devfreq_wq
   58 root      rt   0       0      0      0 S   0.0   0.0   0:00.00 watchdogd
   61 root      20   0       0      0      0 S   0.0   0.0   0:01.86 kswapd0
  100 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kthrotld
  101 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 acpi_thermal_pm
  102 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 nvme-wq
  103 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 nvme-reset-wq
  104 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 nvme-delete-wq
  105 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 ipv6_addrconf
  114 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kstrp
  123 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 charger_manager
  148 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 ttm_swap
  185 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 ata_sff
  186 root      20   0       0      0      0 S   0.0   0.0   0:00.00 scsi_eh_0
  187 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 scsi_tmf_0
  188 root      20   0       0      0      0 S   0.0   0.0   0:00.00 scsi_eh_1
  189 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 scsi_tmf_1
  195 root       0 -20       0      0      0 I   0.0   0.0   0:00.04 kworker/1:1H-kblockd
  197 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:1H-kblockd
  199 root       0 -20       0      0      0 I   0.0   0.0   0:00.01 kworker/3:1H-kblockd
  206 root       0 -20       0      0      0 I   0.0   0.0   0:00.01 kworker/2:1H-kblockd
  209 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/u9:0-hci0
  221 root      20   0       0      0      0 S   0.0   0.0   0:00.49 jbd2/sda2-8
  222 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 ext4-rsv-conver
  279 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 irq/125-mei_me
  290 root      -2   0       0      0      0 S   0.0   0.0   0:01.40 i915/signal:0
  291 root      -2   0       0      0      0 S   0.0   0.0   0:00.00 i915/signal:1
  292 root      -2   0       0      0      0 S   0.0   0.0   0:00.00 i915/signal:2
  293 root      -2   0       0      0      0 S   0.0   0.0   0:00.00 i915/signal:6
  301 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 cfg80211
  306 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/u9:1-hci0
 6927 root      20   0       0      0      0 I   0.0   0.0   0:00.95 kworker/u8:3-phy0
 7916 root      20   0       0      0      0 I   0.0   0.0   0:00.81 kworker/u8:1-i915
 9428 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/3:0-events
 9887 root      20   0       0      0      0 I   6.2   0.0   0:00.27 kworker/u8:0-events_freezable_power_
 9894 root      20   0       0      0      0 I   0.0   0.0   0:00.22 kworker/1:1-events
 9899 root      20   0       0      0      0 I   0.0   0.0   0:00.06 kworker/0:1-events
 9900 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/2:0-events
10083 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/3:1-events
10091 root      20   0       0      0      0 I   0.0   0.0   0:01.72 kworker/2:2-events
10651 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/1:2-events
10664 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/2:1-events
10673 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0
21035 root      20   0       0      0      0 I   0.0   0.0   0:00.40 kworker/0:2-events
21625 root      20   0       0      0      0 I   0.0   0.0   0:15.34 kworker/1:0-events
31168 root      20   0       0      0      0 I   0.0   0.0   0:00.41 kworker/3:2-events

The problem is solved after switching to the lts kernel so I suspect it to be caused by a module.

Last edited by V1del (2018-09-18 11:23:57)

Offline

#2 2018-09-13 15:43:21

loqs
Member
Registered: 2014-03-06
Posts: 18,012

Re: Huge memory leak on linux kernel 4.18

Welcome to the arch linux forums coolsidd.  You mentioned the past few weeks but no version numbers if you downgrade to 4.17.14.arch1-1 does that have the issue?

Offline

#3 2018-09-13 15:53:23

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

Currently on 4.18.6-arch1-1. I will revert and check that tonight (It takes a couple of hours for the leak to show up). Till then here are the outputs of lspci -k

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
	Subsystem: Hewlett-Packard Company Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers
	Kernel driver in use: skl_uncore
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
	Subsystem: Hewlett-Packard Company Skylake GT2 [HD Graphics 520]
	Kernel driver in use: i915
	Kernel modules: i915
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
	Subsystem: Hewlett-Packard Company Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
	Kernel driver in use: proc_thermal
	Kernel modules: processor_thermal_device
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP USB 3.0 xHCI Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP Thermal subsystem
	Kernel driver in use: intel_pch_thermal
	Kernel modules: intel_pch_thermal
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP CSME HECI
	Kernel driver in use: mei_me
	Kernel modules: mei_me
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP SATA Controller [AHCI mode]
	Kernel driver in use: ahci
	Kernel modules: ahci
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)
	Kernel driver in use: pcieport
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
	Kernel driver in use: pcieport
00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #6 (rev f1)
	Kernel driver in use: pcieport
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP LPC Controller
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP PMC
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP HD Audio
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP SMBus
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] (rev 83)
	Subsystem: Hewlett-Packard Company Radeon R5 M330
	Kernel driver in use: radeon
	Kernel modules: radeon, amdgpu
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)
	Subsystem: Hewlett-Packard Company RTL810xE PCI Express Fast Ethernet controller
	Kernel driver in use: r8169
	Kernel modules: r8169
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter
	Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter
	Kernel driver in use: rtl8723be
	Kernel modules: rtl8723be

and on the lts

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 08)
	Subsystem: Hewlett-Packard Company Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers
	Kernel driver in use: skl_uncore
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
	Subsystem: Hewlett-Packard Company Skylake GT2 [HD Graphics 520]
	Kernel driver in use: i915
	Kernel modules: i915
00:04.0 Signal processing controller: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem (rev 08)
	Subsystem: Hewlett-Packard Company Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
	Kernel driver in use: proc_thermal
	Kernel modules: processor_thermal_device
00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP USB 3.0 xHCI Controller
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP Thermal subsystem
	Kernel driver in use: intel_pch_thermal
	Kernel modules: intel_pch_thermal
00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP CSME HECI
	Kernel driver in use: mei_me
	Kernel modules: mei_me
00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP SATA Controller [AHCI mode]
	Kernel driver in use: ahci
	Kernel modules: ahci
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #5 (rev f1)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #6 (rev f1)
	Kernel driver in use: pcieport
	Kernel modules: shpchp
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP LPC Controller
00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP PMC
	Kernel driver in use: intel_pmc_core
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP HD Audio
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl
00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21)
	Subsystem: Hewlett-Packard Company Sunrise Point-LP SMBus
	Kernel driver in use: i801_smbus
	Kernel modules: i2c_i801
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] (rev 83)
	Subsystem: Hewlett-Packard Company Radeon R5 M330
	Kernel driver in use: radeon
	Kernel modules: radeon, amdgpu
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)
	Subsystem: Hewlett-Packard Company RTL810xE PCI Express Fast Ethernet controller
	Kernel driver in use: r8169
	Kernel modules: r8169
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8723BE PCIe Wireless Network Adapter
	Subsystem: Hewlett-Packard Company RTL8723BE PCIe Wireless Network Adapter
	Kernel driver in use: rtl8723be
	Kernel modules: rtl8723be

My wifi driver does not work properly on lts. Also I once switched to amdgpu to use opencl for blender. I have reverted since then but I have not yet uninstalled the module.

Offline

#4 2018-09-14 11:20:39

saga
Member
Registered: 2016-10-25
Posts: 14

Re: Huge memory leak on linux kernel 4.18

The memory usage of my arch linux system keeps increasing during usage. I'm sure I'm not confusing my issue with the hard drive data caching behaviour. This behaviour isn't observed if I boot with lts kernel. This is the output of `free -m` from a tty after using my system for a couple of hours with kernel 4.18.6, with no user programs running:

              total        used        free      shared  buff/cache   available
Mem:           7901        2179        3873           1        1849        5425
Swap:             0           0           0

As you can see the memory usage has risen up to over 2 GB. No such issue appears with lts kernel.

It's a bit of a bummer since wifi drivers for kernel 4.18 finally provide really good signal with realtek cards, and I can't use it because of this memory issue.

Offline

#5 2018-09-14 12:58:11

TheSgtBilko
Member
Registered: 2013-08-13
Posts: 88

Re: Huge memory leak on linux kernel 4.18

I do NOT see any of that on my systems.
E.g. One of my systems (4.18.6 kernel) has been up for at least 24h
Remote desktop into it by xrdp backend.
Running full xfce desktop and asorted apps for 10-12 hours.
After log out (closing xfce and disconnecting) free -m gives:

              total        used        free      shared  buff/cache   available
Mem:           7429         117         368           0        6943        7049
Swap:          2047           0        2047

Edit: Clarify

Last edited by TheSgtBilko (2018-09-14 18:29:34)

Offline

#6 2018-09-14 13:46:15

seth
Member
Registered: 2012-09-03
Posts: 58,342

Re: Huge memory leak on linux kernel 4.18

https://bbs.archlinux.org/viewtopic.php … 6#p1807546
But "free" alone is no good indicator, check  /proc/meminfo and top (latter to see if any userspace process - there are *always* dozens - is the offender)

Offline

#7 2018-09-14 14:27:34

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

The memory leak disappeared after switching to the older kernel. Will mark this as solved if the memory leak doesn't appear till tomorrow.

Offline

#8 2018-09-14 14:46:01

loqs
Member
Registered: 2014-03-06
Posts: 18,012

Re: Huge memory leak on linux kernel 4.18

I would describe that as a workaround rather than a fix.  You could switch to linux-lts but there will still be an issue with 4.18+.

Offline

#9 2018-09-14 15:14:35

saga
Member
Registered: 2016-10-25
Posts: 14

Re: Huge memory leak on linux kernel 4.18

seth wrote:

https://bbs.archlinux.org/viewtopic.php … 6#p1807546
But "free" alone is no good indicator, check  /proc/meminfo and top (latter to see if any userspace process - there are *always* dozens - is the offender)

I've checked both of them and they give similar results. There don't appear to be any memory hungry processes either. As I said, this issue disappears if I boot with lts kernel, so it must have something to do with the new kernel.

Offline

#10 2018-09-14 17:49:09

loqs
Member
Registered: 2014-03-06
Posts: 18,012

Re: Huge memory leak on linux kernel 4.18

Is the issue present using linux 4.17.14.arch1-1?

Offline

#11 2018-09-15 05:56:49

saga
Member
Registered: 2016-10-25
Posts: 14

Re: Huge memory leak on linux kernel 4.18

loqs wrote:

Is the issue present using linux 4.17.14.arch1-1?

No it wasn't.

Offline

#12 2018-09-15 07:51:52

seth
Member
Registered: 2012-09-03
Posts: 58,342

Re: Huge memory leak on linux kernel 4.18

Though we've not seen the actual meminfo yet, you suggest it's the same issue, so I'd suggest to hook onto the other thread and report this for deletion or merging to focus efforts.

Offline

#13 2018-09-15 12:33:12

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

loqs wrote:

I would describe that as a workaround rather than a fix.  You could switch to linux-lts but there will still be an issue with 4.18+.

Should I file it as a bug in the kernel? I could also be a bug in one of the modules that I am using.

The output of diff of lspci -k shows an additional shpchp module in 4.18+. Note this module is not appearing in either lts or 4.17.11. Could it be the culprit?
I am now testing it by loading it on 4.17.11, if I see a memory leak now I will blacklist it (not sure if it is the right idea).

Offline

#14 2018-09-17 10:53:06

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

After reverting back to 4.18+ I am still experiencing the memory leak. After a lot of experimentation, the leak still remains. I am still not sure which module is causing it. Could anyoune share their thoughts on what should be done next. I really don't want to switch to lts since my wifi does not work properly on it. I am thinking of building kedr on my system. Is there a better alternative?

Offline

#15 2018-09-17 11:46:36

loqs
Member
Registered: 2014-03-06
Posts: 18,012

Re: Huge memory leak on linux kernel 4.18

Not sure if they are better alternatives but you could try 4.19-rc4 or bisect between 4.17 and 4.18.

Offline

#16 2018-09-18 05:24:23

swiftgeek
Member
Registered: 2011-04-19
Posts: 31

Re: Huge memory leak on linux kernel 4.18

Can confirm, haven't tried closing X11 yet but nothing in htop accounts back to total memory usage (used, not buffers/cache)
(9 days of uptime)

# smem -twk
Area                           Used      Cache   Noncache 
firmware/hardware                 0          0          0 
kernel image                      0          0          0 
kernel dynamic memory          3.9G     458.5M       3.5G 
userspace memory               1.5G     399.2M       1.1G 
free memory                    2.3G       2.3G          0 
----------------------------------------------------------
                               7.8G       3.2G       4.6G

Last edited by swiftgeek (2018-09-18 05:37:46)

Offline

#17 2018-09-18 07:44:57

saga
Member
Registered: 2016-10-25
Posts: 14

Re: Huge memory leak on linux kernel 4.18

Here's the output of `cat /proc/meminfo` after a couple of hours of usage of my laptop with linux kernel 4.18.7.arch1.1:

MemTotal:        8091176 kB
MemFree:         3800108 kB
MemAvailable:    6221892 kB
Buffers:          828688 kB
Cached:          1575908 kB
SwapCached:            0 kB
Active:          1498860 kB
Inactive:         962800 kB
Active(anon):      57996 kB
Inactive(anon):     2976 kB
Active(file):    1440864 kB
Inactive(file):   959824 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                12 kB
Writeback:             0 kB
AnonPages:         57116 kB
Mapped:           108664 kB
Shmem:              3912 kB
Slab:             387176 kB
SReclaimable:     327932 kB
SUnreclaim:        59244 kB
KernelStack:        4000 kB
PageTables:         4248 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     4045588 kB
Committed_AS:     702464 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:      644988 kB
DirectMap2M:     7663616 kB
DirectMap1G:     1048576 kB

With no other userspace programs running besides the shell.

Last edited by saga (2018-09-18 07:45:52)

Offline

#18 2018-09-18 09:24:38

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

Could you give us the output of lspci -vnn. I am also facing the same issue https://bbs.archlinux.org/viewtopic.php?id=240381

Offline

#19 2018-09-18 10:01:54

progandy
Member
Registered: 2012-05-17
Posts: 5,258

Re: Huge memory leak on linux kernel 4.18

While bisecting, it may be possible to enable kmemleak and use it to check for the leak. This should be faster than waiting for used memory in the free output.

https://www.kernel.org/doc/html/v4.18/d … mleak.html


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#20 2018-09-18 11:23:12

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,086

Re: Huge memory leak on linux kernel 4.18

Merging the two topics, please focus on this one for a solution/debugging regarding this leak.

Offline

#21 2018-09-18 19:46:41

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

Woah seems like kmemleak found something. Could someone please make sense of it as I clearly don't understand this. Here is the output from kmemleak
https://gist.github.com/coolsidd/d8a1d5 … 6a6b243dc4

Offline

#22 2018-09-18 19:56:28

progandy
Member
Registered: 2012-05-17
Posts: 5,258

Re: Huge memory leak on linux kernel 4.18

I can't make much sense from it, but did you try to narrow the result down? First clear the kmemleak buffer after the boot process. The used memory is growing during normal operation, so possible leaks during the boot process should be not important. Then compare the output of a bugfree 4.17.XY with the buggy 4.18 release, you can probably rule out any entry that is in both logs.

Edit: But before doing that, try what happens if you remove the rtlwifi, rtl_pci and maybe amdgpu modules and check if the memory usage still grows. The leaks seem to come from these modules.

Last edited by progandy (2018-09-18 20:02:28)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#23 2018-09-18 19:59:06

seth
Member
Registered: 2012-09-03
Posts: 58,342

Re: Huge memory leak on linux kernel 4.18

After some pci probing and the lion share seems to be rtl_pci interrupt handling (your network driver)
Try to unload the module (it's most likely a dependency for some rtlxxxxxxxxx module) and check the memory drain.

Offline

#24 2018-09-18 20:41:58

coolsidd
Member
Registered: 2018-09-13
Posts: 9

Re: Huge memory leak on linux kernel 4.18

I have updated the gist with the output of kmemleak after clearing and scanning (done after about 45 mins of runtime)
https://gist.github.com/coolsidd/d8a1d5 … /revisions

As for the amdgpu I don't believe that it is the cause (of atleast the major part) of the leak. It was the first module I removed while checking so I can confirm that the leak persists after removing amdgpu.

As for the rtl8723be (my network driver) , the lts version is very different doesn't properly work (it does not have the antenna select option). However I have been using this module since a year and it is also present of 4.17.x. Were there any changes in this version (their github page does not show any major changes since last 6 months). I will build for 4.17.x tomorrow to confirm whether the leak is due to the rtl drivers.

Offline

#25 2018-09-18 21:09:23

progandy
Member
Registered: 2012-05-17
Posts: 5,258

Re: Huge memory leak on linux kernel 4.18

There were a few commits for rtlwifi between 4.17.14 and 4.18.6
https://git.kernel.org/pub/scm/linux/ke … 4..v4.18.6


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB