On Fri, 24 Jan 2020 08:55:25 +0000, The Natural Philosopher wrote:
> On 24/01/2020 08:18, Andy Burns wrote:
>> Jan Panteltje wrote:
>>
>>> top shows:
>>>
>>> MiB Mem : 3906.0 total, 71.6 free, 375.9 used, 3458.6
>>> buff/cache MiB Swap: 100.0 total, 19.9 free, 80.1
used.
>>> 3364.1 avail Mem
>>>
>>> kernel claims all memory space as cache
>>
>> You have that backwards.
>>
>> From your 3906 MB, 375 MB is used, the kernel is keeping 71 MB free
>> for
>> immediate needs, that leaves 3458 MB that would be unused, so it
>> temporarily gets used for caching, if the 71 MB is used up, the cache
>> will be lowered and that memory become available for use ... no point
>> in letting memory be unused when they system can benefit from using it
>> as cache.
>
> Exactly. Cache memory is essntially mirroring the disk(s). If it gets
> full the disk is activated and any writable data written to it. Read
> data is simply discarded.
>
> Why the Pi is using swap is another matter entirely.
>
> If it bothers you stop it, or configure a small ramdisk as swap.
>
Putting swap space in a ramdisk doesn't help because that is (obviously!)
mapped into RAM, and so will merely reduce the RAM available for other
purposes. If you want to use fixed swap space, rather than the default
swap file, create a dedicated swap partition on spinning rust or an SSD,
BUT I would not put one on an SD card if its at all frequently used. A
reasonable size for fixed swap space is twice RAM size.
Use gparted or one of the older command-line tools (cfdisk, fdisk etc.)
to manage device partitioning. Running "apropos partition" will show you
which partition managers are installed and, as always, 'man' describes
what each can do and how to use it. Swap partitions don't need to be
formatted after creation.
--
Martin | martin at
Gregorie | gregorie dot org
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|