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 Sat 07 Dec 2019, 10:14
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to flush the RAM ?
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
Bernhardiner


Joined: 03 Jul 2018
Posts: 43

PostPosted: Sat 09 Feb 2019, 06:04    Post subject:  How to flush the RAM ?  

Hi,

does a script exist or which command can be used to flush the RAM in any Puppy?

Regards,
Bernhardiner
Back to top
View user's profile Send private message Visit poster's website 
ttuuxxx


Joined: 05 May 2007
Posts: 11240
Location: Ontario Canada,Sydney Australia

PostPosted: Sat 09 Feb 2019, 06:19    Post subject:  

Here try this, just extract it and run it in a terminal
ram.tar.gz
Description 
gz

 Download 
Filename  ram.tar.gz 
Filesize  262 Bytes 
Downloaded  57 Time(s) 

_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile
Back to top
View user's profile Send private message Visit poster's website 
bigpup


Joined: 11 Oct 2009
Posts: 12969
Location: S.C. USA

PostPosted: Sat 09 Feb 2019, 07:12    Post subject:  

The question is.
Why do you want to do this?
What is the problem?

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer)
Back to top
View user's profile Send private message 
Bernhardiner


Joined: 03 Jul 2018
Posts: 43

PostPosted: Sat 09 Feb 2019, 07:25    Post subject:  

Thank you, ttuuxxx.
It seems to work.

It can be the RAM is not big enough, or it is better not to save everything in the save file.

Regards,
Bernhardiner
Back to top
View user's profile Send private message Visit poster's website 
ttuuxxx


Joined: 05 May 2007
Posts: 11240
Location: Ontario Canada,Sydney Australia

PostPosted: Sat 09 Feb 2019, 07:39    Post subject:  

Bernhardiner wrote:
Thank you, ttuuxxx.
It seems to work.

It can be the RAM is not big enough, or it is better not to save everything in the save file.

Regards,
Bernhardiner
Your welcome also delete /root/.cache on a regular basis Smile
_________________
http://audio.online-convert.com/ <-- excellent site
http://samples.mplayerhq.hu/A-codecs/ <-- Codec Test Files
http://html5games.com/ <-- excellent HTML5 games Smile
Back to top
View user's profile Send private message Visit poster's website 
bigpup


Joined: 11 Oct 2009
Posts: 12969
Location: S.C. USA

PostPosted: Sat 09 Feb 2019, 07:55    Post subject:  

The save process, for updating the save, is only going to put stuff in the save that needs to be in the save.
It does not put everything that is in memory in the save.
This is not something to worry about.

If you do not want anything new going into the save automatically.
Setup the options in Puppy Event Manager>Save Session.

To make a hard drive install be able to use these options.
In the menu entry that boots it.
Change the pmedia= to pmedia=usbflash.
That will make it run in pupmode 13 and not pupmode 12.

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer)
Back to top
View user's profile Send private message 
Bernhardiner


Joined: 03 Jul 2018
Posts: 43

PostPosted: Sat 09 Feb 2019, 08:31    Post subject:  

Hi,

Thanks again, ttuuxxx.

Somewhere in this forum it is written that everything in RAM is saved in the save file.
That is independent from saving manually or automatically.
Thanks for the info about pmedia=usbflash, bigpup.

Regards,
Bernhardiner
Back to top
View user's profile Send private message Visit poster's website 
backi

Joined: 27 Feb 2011
Posts: 1845
Location: GERMANY

PostPosted: Sat 09 Feb 2019, 08:58    Post subject:  

Hi Tttuuxxx !
Your script does work .......but.....it also un-mounts the swapdrive without re-enabling it again......this is a bit annoying.
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12969
Location: S.C. USA

PostPosted: Sat 09 Feb 2019, 09:18    Post subject:  

Quote:
Somewhere in this forum it is written that everything in RAM is saved in the save file.

No.
That is someone making too general a statement.

Not everything in ram goes into the save.
Only any changed settings.
Only anything added to Puppy that is not already in the save.
Only stuff already in the save that has changed and only those changes.

_________________
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
YaPI(any iso installer)
Back to top
View user's profile Send private message 
vovchik


Joined: 23 Oct 2006
Posts: 1512
Location: Ukraine

PostPosted: Sat 09 Feb 2019, 09:22    Post subject:  

Dear all,

This works for me:

Code:
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>

if [ "$(whoami)" != "root" ]
then
  echo "You have to run this script as Superuser!"
  exit 1
fi

# Get Memory Information
freemem_before=$(cat /proc/meminfo | grep MemFree | tr -s ' ' | cut -d ' ' -f2) && freemem_before=$(echo "$freemem_before/1024.0" | bc)
cachedmem_before=$(cat /proc/meminfo | grep "^Cached" | tr -s ' ' | cut -d ' ' -f2) && cachedmem_before=$(echo "$cachedmem_before/1024.0" | bc)

# Output Information
echo -e "This script will clear cached memory and free up your ram.\n\nAt the moment you have $cachedmem_before MiB cached and $freemem_before MiB free memory."

# Test sync
if [ "$?" != "0" ]
then
  echo "Something went wrong, It's impossible to sync the filesystem."
  exit 1
fi

# Clear Filesystem Buffer using "sync" and Clear Caches
sync && echo 3 > /proc/sys/vm/drop_caches

freemem_after=$(cat /proc/meminfo | grep MemFree | tr -s ' ' | cut -d ' ' -f2) && freemem_after=$(echo "$freemem_after/1024.0" | bc)

# Output Summary
echo -e "This freed $(echo "$freemem_after - $freemem_before" | bc) MiB, so now you have $freemem_after MiB of free RAM."

exit 0


With kind regards,
vovchik
Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 776

PostPosted: Sat 09 Feb 2019, 09:51    Post subject:  

bigpup
I use that pmedia=usbflash with syslinux.cfg, but where does one make the related change in a Grub4Dos configured system?
TIA

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 1337
Location: Connecticut, United States

PostPosted: Sat 09 Feb 2019, 09:53    Post subject:  

@vovchik

nice little script..thanks for the tip.
Back to top
View user's profile Send private message Visit poster's website 
musher0

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

PostPosted: Sat 09 Feb 2019, 11:39    Post subject:  

Hello, all.

About 4 years ago, the French side (forum members jplt, Médor, myself,
with suggestions from ASRI and augras, etc.) produced this.

Parms you can pass as $1 are as follows:
# "chrono" : save as a history file; no window pops up;

# "simple" : for operation from the terminal;

# "histo" : combines the two above.
If you wish to consult the history, for monitoring purposes.
-=> useful if you think something is wrong with your RAM; <=-
You run it every now and then during your session. Readings are saved
in file /root/my-documents/tmp/suivimev.his

# "flafla", "bling" or nothing: show results with transparency (default).

E.g. < ./cleanup_memory bling > will show the results as in the scrot.
The title bar shows how much RAM was recoup'ed, and if swap is in use.

Whatever little text there is is shown in the language of the system. At
this time EN or FR only; translators for other languages welcome.

Requires the real less, not the busybox one. If
Code:
ls -Algor /usr/bin/less
does not show a symbolic link, you have the real less.

Enjoy. BFN.
cleanup_memory.zip
Description  This latest v. corrects a bug in the less display, in histo and simple modes.
Unzip in a "bin" directory in your $PATH and make executable. Contains a
"cleanup_memory" symlink to script cleanup_memory4b1.
zip

 Download 
Filename  cleanup_memory.zip 
Filesize  2.81 KB 
Downloaded  30 Time(s) 
history-mode.jpg
 Description   
 Filesize   143.24 KB
 Viewed   170 Time(s)

history-mode.jpg

cleanup-RAM-4b-EN.jpg
 Description   Default display.
 Filesize   113.63 KB
 Viewed   183 Time(s)

cleanup-RAM-4b-EN.jpg


_________________
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 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13388
Location: Arizona USA

PostPosted: Sat 09 Feb 2019, 14:00    Post subject:  

I think the browser is the usual culprit that fills the RAM with junk. I find that restarting the graphical server, which kills Firefox, then restarting Firefox and telling it to restore the tabs it had open before it was killed, seems to clear out a lot of junk while leaving the browser the way it was before restarting the graphical server.
Back to top
View user's profile Send private message 
dancytron

Joined: 18 Jul 2012
Posts: 1411

PostPosted: Sat 09 Feb 2019, 15:55    Post subject:  

B.K. Johnson wrote:
bigpup
I use that pmedia=usbflash with syslinux.cfg, but where does one make the related change in a Grub4Dos configured system?
TIA


Just add it on the line that starts with "kernel", like so:

Quote:

title Puppy Linux precise572a in sda3 dir precise572a
rootnoverify (hd0,1)
kernel /precise572a/vmlinuz pmedia=usbflash psubdir=precise572a
initrd /precise572a/initrd.gz
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
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.0656s ][ Queries: 13 (0.0118s) ][ GZIP on ]