1) Using this command:
Code: Select all
echo 3 > /proc/sys/vm/drop_caches
2) the second method is to simply unmount the drive you were reading/writing from, memory will be flushed. This method can obviously only be used if the drive is not in use.
Code: Select all
echo 3 > /proc/sys/vm/drop_caches
Code: Select all
sync;echo 3 > /proc/sys/vm/drop_caches;wait
I want to use this, but...Code: Select all
echo 3 > /proc/sys/vm/drop_caches
Hi, greengeek. This explains it well: https://www.linuxatemyram.com/ Use the free command in terminal to check the status. The important thing is that the total free memory as reported, could actually be less than the actual free memory available. Evenso, in my experience, the indication of very low total free memory alone could be an indication of an imminent crash.greengeek wrote:Hi Nic - two questions:
- how can I work out the current state of cache? Is there some way to know if it is choked?
- What form of system crash were you experiencing? Did you experience the personal storage icon turning red?
Hi, B.K. Johnson. This relates to the system memory cache (not your browser cache). Run theB.K. Johnson wrote:Hello nic007I want to use this, but...Code: Select all
echo 3 > /proc/sys/vm/drop_caches
- I don't understand what it does [I have my newbie dunce cap on ]
Despite not getting an error when it's run, how do I know it is working: cache used before and after
My Firefox cache wasn't emptied when run
Code: Select all
free
Same here, no savefile. My storage meter also never used to suggest any problem either - except I have noticed lately it starts to run low (red) under two specific conditions:nic007 wrote:I don't have a savefile. The personal storage metre almost always report 1GB free.
This is an area I do not understand well enough. I always thought that if we ran without savefile then the "personal storage" meter became irrelevant - but that is not the case. It is certainly reporting that something is getting clagged up under heavy resource usage.nic007 wrote: That metre has nothing to do with the system process of caching memory I think
No, I can't say I am sure of that. I don't really understand all the different caches. However, I don't think the browser can be using all my memory as I never see memory fill up when just browsing - even long sessions on youtube or downloading vids etc. That does not seem to reduce the "personal storage" figure seen by hovering over the icon (and there would have to be enormous browser cache to fill 6GB).nic007 wrote: Are you sure it is not the browser cache consuming all your memory?
Code: Select all
crontab -u root
Code: Select all
*/30 * * * * sync && echo 3 > /proc/sys/vm/drop_caches && wait
If you are running with no save at all.nic007 wrote:
That metre has nothing to do with the system process of caching memory I think
This is an area I do not understand well enough. I always thought that if we ran without savefile then the "personal storage" meter became irrelevant - but that is not the case. It is certainly reporting that something is getting clagged up under heavy resource usage.
Clearly that icon is also reflecting something to do with RAM usage and the ability of the system to move data (and I guess code) around the place effectively.
Hi Musher - is there any functional difference bwteen your syntax - using semicolon delimiter ";" and Tyrobeginners syntax using "&&" ?musher0 wrote:I use the < sync > command before so that any data still in transit is sent to the destination before I start "vacuuming" the RAM, like this:Also with < wait > at the end, to make sure my "vacuuming" is over before bashCode: Select all
sync;echo 3 > /proc/sys/vm/drop_caches;wait
processes another command.
BFN.
greengeek wrote:Hi Musher - is there any functional difference bwteen your syntax - using semicolon delimiter ";" and Tyrobeginners syntax using "&&" ?musher0 wrote:I use the < sync > command before so that any data still in transit is sent to the destination before I start "vacuuming" the RAM, like this:Also with < wait > at the end, to make sure my "vacuuming" is over before bashCode: Select all
sync;echo 3 > /proc/sys/vm/drop_caches;wait
processes another command.
BFN.
SourceDouble Ampersand
A double ampersand && in Bash means AND and can be used to separate
a list of commands to be run sequentially.
Commands separated by a double ampersand && are to be run
synchronously, with each one running only if the last did not fail (a fail is
interpreted as returning a non-zero return status).
This can be especially handy for when you have a couple of commands to
run, but you don’t want the second to be run if the first fails.