Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 18 Oct 2019, 14:26
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Release cached memory manually (with user input)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Author Message
nic007


Joined: 13 Nov 2011
Posts: 3066
Location: Cradle of Humankind

PostPosted: Fri 08 Feb 2019, 05:57    Post subject:  

Revisiting this thread. After thorough testing for months I do NOT recommend this command to free memory, it leads to unwanted machine freezes which can be avoided.

My scenario. I run in RAM without swapfile. I have 2GB of RAM and often watch videos for an extended period of time (on most occasions HD video). Generally everything goes well for a few hours before a freeze/lock up may occur. Using the drop caches command to free memory definitely increases the occurance of machine freezes. I have found that the most effective way to avoid any freezes is to occasionally unmount and re-mount the drive which you are playing videos from. Unmounting the drive automatically clears the memory caches but does not present the same problems afterwards as with using the drop caches command.
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 14406
Location: Gatineau (Qc), Canada

PostPosted: Fri 08 Feb 2019, 09:00    Post subject:  

greengeek wrote:
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:
Code:
sync;echo 3 > /proc/sys/vm/drop_caches;wait
Also with < wait > at the end, to make sure my "vacuuming" is over before bash
processes another command.

BFN.
Hi Musher - is there any functional difference bwteen your syntax - using semicolon delimiter ";" and Tyrobeginners syntax using "&&" ?
Quote:
Double 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.
Source

Whereas the semi-colon is a typograpic convention replacing the line feed.
This convention enables the user to write several commands on the same
line. It is handy to write "one-liners", but it does not check the status of
the previous command.

Use Tyro's suggestion if you prefer. It can't hurt. He's probably using the
double ampersands because he is suggesting a cron job context.

As for me, I do not see the need for checking if you flush the caches
occasionally. So I use the semi-colon as separator.

Same for "Médor", the forum member who taught me this sequence of
commands for this purpose.

The form with semi-colons for this trick can also be seen in this tecmint
article and elsewhere.

IHTH.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 2 [17 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0343s ][ Queries: 12 (0.0073s) ][ GZIP on ]