Page 1 of 1

Feature Request: Memory Cleaning Daemon

Posted: 30 Jun 2021, 02:08
by Saijin_Naib
I think it would be great if we could have an (optional) service we could run to try and flush cache, etc, especially on lower-spec units like the F2-210 I'm using.

It would consist of something like this as a cron job to run on a schedule that the user could modify:
sync; echo 3 > /proc/sys/vm/drop_caches

Source:
https://www.tecmint.com/clear-ram-memor ... -on-linux/

I was noticing that after a large SMB transfer of about 800GB that my F2-210 was not releasing the cache and was hovering at around 44% memory usage. I think having this daemon run in the background would be helpful.

Re: Feature Request: Memory Cleaning Daemon

Posted: 10 Jul 2021, 12:56
by TMroy
Things are not as you think. Memory is designed to speed up system performance. Because of the lack of cache, system performance will slow down actually, and the cache will still be reloaded soon or later. Why do you have to keep the memory usage low? In my opinion, the best option is to keep the system in the best state of operation, instead of always low memory usage.

Re: Feature Request: Memory Cleaning Daemon

Posted: 10 Jul 2021, 22:25
by Saijin_Naib
{L_BUTTON_AT}TMroy
I agree with you. However, there are a number of processes on my TOS device that seem to keep growing in RAM usage over time, and I am concerned about the long-term stability of this platform under load if resource consumption keeps growing.

I've seen too many posts here of other people with F2-210 having random reboots, crashes, power-off, etc. which look like possible OOM crash/reset patterns.

Judging by how high the memory usage under load gets with my F2-210 (70%+ under load), I am concerned that such behavior is not far off for my unit. I have nothing running but Samba (no apps, even), so there is really not much more I can do on my end to keep it running well, as you suggest.

Re: Feature Request: Memory Cleaning Daemon

Posted: 13 Jul 2021, 13:49
by TMroy
So the issue will be which process always take a lot of memory, and is this reasonable? need to check case by case.

Re: Feature Request: Memory Cleaning Daemon

Posted: 24 Jul 2021, 11:15
by demetry14
Saijin_Naib wrote: 30 Jun 2021, 02:08 I think it would be great if we could have an (optional) service we could run to try and flush cache, etc, especially on lower-spec units like the F2-210 I'm using.

It would consist of something like this as a cron job to run on a schedule that the user could modify:
sync; echo 3 > /proc/sys/vm/drop_caches

Source:
https://www.tecmint.com/clear-ram-memor ... -on-linux/

I was noticing that after a large SMB transfer of about 800GB that my F2-210 was not releasing the cache and was hovering at around 44% memory usage. I think having this daemon run in the background would be helpful.
crontab -e
* * * * * command_to_execute
| | | | |Day of the Week ( 0 - 6 ) ( Sunday = 0 )
| | | Month ( 1 - 12 )
| | Day of Month ( 1 - 31 )
| Hour ( 0 - 23 )
Min ( 0 - 59 )

in crontab add new lines for (change * * * * * to your needed values and echo something higher than 60 to relieve more ram):
* * * * * sync; echo 3 > /proc/sys/vm/drop_caches


swappiness (change echo 60 to your needed value):
0 : Swapping will be activated urgently only to avoid out of memory condition.
60 : This is the default value and means that from 40% of Ram occupancy, the kernel writes to the swap.
100 : The kernel will swap aggressively.

in /etc/sysctrl.conf add to the bottom and provide a number above 60.
vm.swappiness =