Some applications, when working for days can "grow up" in memory because there might be memory leaks (memory is reserved and not returned when not needed). When you have less memory (because of memory leaks) system moves information from memory to disk (swap partitions) more often, and this is probably the reason of slowing down you experience.
You probably don't need to restart to clear the ram and swap, as you can clear both without restarting:
Clearing Swap: You can turn swap off and on again to clear it (make you have enough spare memory using free -m, top or similar) using sudo swapoff -a && sudo swapon -a. If stuff is moved to swap when you have enough free memory, and you don't want it to be, you need to configure swappiness.
Clearing Cache: Can be done by the method suggested here: free && sync && echo 3 > /proc/sys/vm/drop_caches && free. Needs to be done as root, so you can run sudo -i beforehand to drop into a root shell, or try enclosing it in sudo sh -c " "
Clearing programs from RAM: By closing open apps you don't need, and killing extra processes (CAREFULLY) in htop by selecting each process and pressing k+Enter (the tree view in htop is very useful here, press t to use it, then you can determine parent processes etc). Some applications (e.g KDE apps in a GNOME environment) start processes that you may not now need, so you can kill those
However, it may still be necessary to close the machine down every so often due to maintenance, memory leaks, overheating, power cuts etc. You also may need to restart to apply system updates (though you may not need to restart the system for kernel updates with kernel 4+),
It will open a program that removes a lot of clutter, old kernels and it will give you a performance boost. Also a reboot every now and then is not bad :)
Some applications, when working for days can "grow up" in memory because there might be memory leaks (memory is reserved and not returned when not needed). When you have less memory (because of memory leaks) system moves information from memory to disk (swap partitions) more often, and this is probably the reason of slowing down you experience.
You probably don't need to restart to clear the ram and swap, as you can clear both without restarting:
Clearing Swap: You can turn swap off and on again to clear it (make you have enough spare memory using
free -m
,top
or similar) usingsudo swapoff -a && sudo swapon -a
. If stuff is moved to swap when you have enough free memory, and you don't want it to be, you need to configure swappiness.Clearing Cache: Can be done by the method suggested here:
free && sync && echo 3 > /proc/sys/vm/drop_caches && free
. Needs to be done as root, so you can runsudo -i
beforehand to drop into a root shell, or try enclosing it insudo sh -c " "
Clearing programs from RAM: By closing open apps you don't need, and killing extra processes (CAREFULLY) in
htop
by selecting each process and pressing k+Enter (the tree view inhtop
is very useful here, press t to use it, then you can determine parent processes etc). Some applications (e.g KDE apps in a GNOME environment) start processes that you may not now need, so you can kill thoseHowever, it may still be necessary to close the machine down every so often due to maintenance, memory leaks, overheating, power cuts etc. You also may need to restart to apply system updates (though you may not need to restart the system for kernel updates with kernel 4+),
You can also open a terminal and do the following
It will open a program that removes a lot of clutter, old kernels and it will give you a performance boost. Also a reboot every now and then is not bad :)