- This topic has 1 reply, 2 voices, and was last updated Jan 24-1:51 am by Anonymous.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Forum for users of antiX Linux. Mean and Lean and Proudly anti-fascist.
Forum › Forums › General › Tips and Tricks › How to clear memory buffer/cache, and how to clear swap memory
Here are my notes on how to clear most of the memory buffer/cache and how to clear swap memory (run these commands as root):
Clear page memory –
sync; echo 1 > /proc/sys/vm/drop_caches
Not recommended – can cause data loss – clear dentries (data structure that represents a directory) and inodes (data structure that represents a file) –
sync; echo 2 > /proc/sys/vm/drop_caches
Clear swap –
swapoff -a && swapon -a
Anyone have any thoughts? I’ve used commands #1 and #3 for a couple years, haven’t had any trouble, and occasionally use command #2. I’d like to know if anyone has a thought on how these commands could be improved, or if you feel they are incorrect or if they are simply a waste of time for any reason.
We haven’t discussed this for a while, maybe not since back in the “antiX oldforums archives” days.
When I saw this topic title today, “linux ate my RAM” popped into my head.
I checked, and by golly ~~ https://www.linuxatemyram.com/ ~~ the site I remember from BackWhen is still available.
The RAM modules are continually (re)energized, regardless “full” or “empty”, eh.
Toward power management BestPractices, and with an eye toward reducing POH (power-on hours), I configure any spinning drives (man hdparm) to quickly power down between uses. So from my perspective, “drop caches” would be counterproductive… unless while managing a machine with < 1GB (?) RAM.
| Cookie | Duration | Description |
|---|---|---|
| cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
| cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
| cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
| cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
| cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
| viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |