Page 1 of 1
[SOLVED] Mageia7 not utilizing free physical mem 4 diskcache

Posted:
Aug 9th, '19, 21:52
by sleepyz
Recently did some updates to system and noticed that very little free memory is allocated to disk cache even though I have much physical memory free available
- Code: Select all
@i5Rig ~]$ free -lm
total used free shared buff/cache available
Mem: 16007 2114 12401 42 1491 13550
Low: 16007 3605 12401
High: 0 0 0
Swap: 9992 0 9992
- Code: Select all
i5Rig ~]$ cat /proc/sys/vm/min_free_kbytes
67584
- Code: Select all
@i5Rig ~]$ cat /proc/meminfo
MemTotal: 16391828 kB
MemFree: 12677428 kB
MemAvailable: 13861512 kB
Buffers: 133624 kB
Cached: 1292084 kB
SwapCached: 0 kB
Active: 2379476 kB
Inactive: 831340 kB
Active(anon): 1786344 kB
Inactive(anon): 45068 kB
Active(file): 593132 kB
Inactive(file): 786272 kB
Unevictable: 32 kB
Mlocked: 32 kB
SwapTotal: 10232372 kB
SwapFree: 10232372 kB
Dirty: 1716 kB
Writeback: 0 kB
AnonPages: 1785120 kB
Mapped: 579044 kB
Shmem: 46336 kB
KReclaimable: 112620 kB
Slab: 236240 kB
SReclaimable: 112620 kB
SUnreclaim: 123620 kB
KernelStack: 11104 kB
PageTables: 27552 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 18428284 kB
Committed_AS: 8581312 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
Percpu: 1744 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 380444 kB
DirectMap2M: 16363520 kB
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 10th, '19, 00:03
by martinw
That just shows how much memory is currently being used for the cache. Try running something that reads a lot of data from disk, and you will see the number go up.
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 10th, '19, 00:22
by sleepyz
I have run two virtualbox sessions, 1 windows 10 allocated with 4GB RAM and 30GB vdi image file and 1 windows 8 alllocated with 3GB RAM and 35GB vdi image file.
- Code: Select all
@i5Rig ~]$ free -lm
total used free shared buff/cache available
Mem: 16007 12789 859 210 2358 2680
Low: 16007 15148 859
High: 0 0 0
Swap: 9992 0 9992
- Code: Select all
@i5Rig ~]$ cat /proc/meminfo
MemTotal: 16391828 kB
MemFree: 635524 kB
MemAvailable: 2648932 kB
Buffers: 64380 kB
Cached: 2283612 kB
SwapCached: 92 kB
Active: 5334776 kB
Inactive: 1849244 kB
Active(anon): 4220924 kB
Inactive(anon): 824648 kB
Active(file): 1113852 kB
Inactive(file): 1024596 kB
Unevictable: 252 kB
Mlocked: 252 kB
SwapTotal: 10232372 kB
SwapFree: 10231860 kB
Dirty: 11124 kB
Writeback: 0 kB
AnonPages: 4836224 kB
Mapped: 9026704 kB
Shmem: 211936 kB
KReclaimable: 211060 kB
Slab: 448132 kB
SReclaimable: 211060 kB
SUnreclaim: 237072 kB
KernelStack: 20464 kB
PageTables: 71364 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 18428284 kB
Committed_AS: 23427828 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
Percpu: 1840 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 1506844 kB
DirectMap2M: 15237120 kB
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 10th, '19, 00:27
by sleepyz
On my other Mageia System it looks like this with hardly any programs running
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 10th, '19, 00:35
by martinw
So you've read more data from disk on that system.
As you read data from disk, it gets cached in free memory. Linux will use all the free memory for this purpose, but as soon as the memory is needed for some other purpose, the oldest data will be discarded and the memory used by the cache will shrink accordingly.
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 10th, '19, 00:36
by sleepyz
After I closed the virtual guest OSs down it did increase the disk cache to 26 percent. So I guess its doing what its supposed to do. But just wonder why my other system has such a high disk cache compared to this on. Isn't memory not used is memory wasted?
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 12th, '19, 09:20
by ITA84
From what I can see, your other system has only 8 GB of RAM, so the difference isn't all that much. I remember my older systems having more disk cache than what I have now, but that was because 1) there was a readahead service (which apparently isn't used anymore) and 2) several programs, including some file indexers, i don't run anymore, so it could just be a difference in the stuff that's installed on your two systems
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 12th, '19, 09:56
by martinw
As already explained, the size of the disk cache is the amount of data currently cached, not the maximum size. Try a test like this:
- Code: Select all
% free -m
total used free shared buff/cache available
Mem: 14014 712 12687 10 613 13005
Swap: 16383 0 16383
% cat Mageia-7.1-i586/Mageia-7.1-i586.iso > /dev/null
% free -m
total used free shared buff/cache available
Mem: 14014 713 8470 10 4830 13000
Swap: 16383 0 16383
% cat Mageia-7.1-x86_64/Mageia-7.1-x86_64.iso > /dev/null
% free -m
total used free shared buff/cache available
Mem: 14014 713 4166 10 9134 12995
Swap: 16383 0 16383
% cat Mageia-7.1-Live-GNOME-x86_64/Mageia-7.1-Live-GNOME-x86_64.iso > /dev/null
% free -m
total used free shared buff/cache available
Mem: 14014 712 1582 10 11719 12993
Swap: 16383 0 16383
% cat Mageia-7.1-Live-Plasma-x86_64/Mageia-7.1-Live-Plasma-x86_64.iso > /dev/null
% free -m
total used free shared buff/cache available
Mem: 14014 699 163 10 13150 13005
Swap: 16383 0 16382
% libreoffice
% free -m
total used free shared buff/cache available
Mem: 14014 705 210 10 13099 12999
Swap: 16383 0 16382
Use any large files you have on your system instead of the ISO files I used. Start a few more programs that consume a lot of memory to see the disk cache shrink further.
Re: Mageia 7 not utilizing free physical memory for disk cac

Posted:
Aug 13th, '19, 05:00
by sleepyz
I tried your suggestion and I come to conclude that my system is working properly. Thank you very much for you time and help
- Code: Select all
@i5rig Mageia-7-x86_64]$ free -m
total used free shared buff/cache available
Mem: 16007 5420 3067 173 7519 10145
Swap: 9992 0 9992
[frank@i5rig Mageia-7-x86_64]$ cat Mageia-7-x86_64.iso > /dev/null
[frank@i5rig Mageia-7-x86_64]$ free -m
total used free shared buff/cache available
Mem: 16007 5380 170 172 10456 10128
Swap: 9992 1 9990
Re: [SOLVED] Mageia7 not utilizing free physical mem 4 diskc

Posted:
Aug 13th, '19, 05:12
by sleepyz
Just want to say to the people of Mageia.. I really love your product since your fork from Mandrivia.