You are not logged in.

#1 2021-10-25 23:16:13

dankcuddlybear
Member
Registered: 2021-10-24
Posts: 19

[SOLVED] What is eating all my RAM?!

I know Linux uses as much free memory as it can for disk caching. But Kinfocenter shows only 6% (about 1.9GiB) is used for disk cache, and a whopping 58% (that's more than 18GiB!) is used by "Application data". I have 31.22GiB RAM total. Sure KDE can be resource-heavy but come on, 18GiB? All I have open is Firefox with a couple of tabs. I've tested KDE on a system with 4GiB RAM and a dual-core pentium processor from 2010 and it worked flawlessly. Just to be sure, I tried using: 'dd if=/dev/zero of=/tmp/memkiller.img status=progress' as root user to see how much RAM I could fill and sure enough, I got to about 12GiB before the system was out of memory and threw a kernel panic. By the way I'm using the linux-zen kernel if that helps.

Last edited by dankcuddlybear (2021-10-26 09:05:57)

Offline

#2 2021-10-26 00:24:55

Ammako
Member
Registered: 2021-07-16
Posts: 267

Re: [SOLVED] What is eating all my RAM?!

"top" in terminal will give you better information.

https://www.man7.org/linux/man-pages/man1/top.1.html

Last edited by Ammako (2021-10-26 00:30:04)

Offline

#3 2021-10-26 01:28:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,497
Website

Re: [SOLVED] What is eating all my RAM?!

dankcuddlybear wrote:

I tried using: 'dd if=/dev/zero of=/tmp/memkiller.img status=progress' as root user to see how much RAM I could fill

That's not at all a useful test.  You just hit the tmpfs limit, not your RAM limit.

If you want real help, provide real diagnostics.  As mentioned above, `top` can be a good tool for identifying processes using ram, but first, just post output from `free` and `cat /proc/meminfo`.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2021-10-26 08:03:27

dankcuddlybear
Member
Registered: 2021-10-24
Posts: 19

Re: [SOLVED] What is eating all my RAM?!

Trilby wrote:
dankcuddlybear wrote:

I tried using: 'dd if=/dev/zero of=/tmp/memkiller.img status=progress' as root user to see how much RAM I could fill

That's not at all a useful test.  You just hit the tmpfs limit, not your RAM limit.

If you want real help, provide real diagnostics.  As mentioned above, `top` can be a good tool for identifying processes using ram, but first, just post output from `free` and `cat /proc/meminfo`.

According to the Arch Wiki, the tmpfs limit is half the available RAM (about 15GiB in my case). Just to be sure I temporarily set the max limit to 32GiB when I did the test.

$ free
               total        used        free      shared  buff/cache   available
Mem:        32739084    18384964    12654904      471848     1699216    13440992
Swap:              0           0           0

$ cat /proc/meminfo
MemTotal:       32739084 kB
MemFree:        12654904 kB
MemAvailable:   13440992 kB
Buffers:          108688 kB
Cached:          1446864 kB
SwapCached:            0 kB
Active:          2042312 kB
Inactive:         319100 kB
Active(anon):    1244844 kB
Inactive(anon):    32880 kB
Active(file):     797468 kB
Inactive(file):   286220 kB
Unevictable:      430932 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:               156 kB
Writeback:             0 kB
AnonPages:       1213816 kB
Mapped:           613164 kB
Shmem:            471848 kB
KReclaimable:     143664 kB
Slab:             246092 kB
SReclaimable:     143664 kB
SUnreclaim:       102428 kB
KernelStack:       13696 kB
PageTables:        28492 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     7972740 kB
Committed_AS:    5622052 kB
VmallocTotal:   34359738367 kB
VmallocUsed:       81880 kB
VmallocChunk:          0 kB
Percpu:             8704 kB
HardwareCorrupted:     0 kB
AnonHugePages:    122880 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:    8200
HugePages_Free:     8200
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:        16793600 kB
DirectMap4k:      263740 kB
DirectMap2M:    11984896 kB
DirectMap1G:    22020096 kB

Last edited by dankcuddlybear (2021-10-26 08:16:32)

Offline

#5 2021-10-26 08:28:18

dankcuddlybear
Member
Registered: 2021-10-24
Posts: 19

Re: [SOLVED] What is eating all my RAM?!

I think I figured out the problem. The system is enabling hugepages for some reason. I remember enabling hugepages when I tried to set up a virtual machine, following instructions from the Arch Wiki. When I turn off hugepages manually:

# umount /dev/hugepages
# echo 0 > /proc/sys/vm/nr_hugepages
$ free
               total        used        free      shared  buff/cache   available
Mem:        32739084     2274844    28118884      797604     2345356    29212800
Swap:              0           0           0

I have about 26.5GiB RAM free. I disabled them by removing the fstab entry when I no longer needed the virtual machine, but hugepages are enabled again when I restart.

$ free
               total        used        free      shared  buff/cache   available
Mem:        32739084    18384964    12654904      471848     1699216    13440992
Swap:              0           0           0
$ grep HugePages_Total /proc/meminfo
HugesPages_Total:  8192

Last edited by dankcuddlybear (2021-10-26 08:45:44)

Offline

#6 2021-10-26 08:48:25

sabroad
Member
Registered: 2015-05-24
Posts: 242

Re: [SOLVED] What is eating all my RAM?!

dankcuddlybear wrote:

I remember enabling hugepages when I tried to set up a virtual machine, following instructions from the Arch Wiki.

In that case, you can disable hugepage allocations by removing /etc/sysctl.d/40-hugepage.conf

wiki wrote:

Now that everything seems to work you can enable hugepages by default if you like. Add to your /etc/sysctl.d/40-hugepage.conf:


--
saint_abroad

Offline

#7 2021-10-26 09:05:44

dankcuddlybear
Member
Registered: 2021-10-24
Posts: 19

Re: [SOLVED] What is eating all my RAM?!

sabroad wrote:

In that case, you can disable hugepage allocations by removing /etc/sysctl.d/40-hugepage.conf

Once again I have overlooked a seemingly obvious cause of my problem. Thanks for pointing that out! My RAM consumption is now back to normal.

Offline

Board footer

Powered by FluxBB