LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-28-2005, 01:24 PM   #1
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Rep: Reputation: 32
Question flush my swap/ram? command?


anyone know of a terminal/run command to clear out my RAM and my swap space? the other OS had a prog called freemem which would clean it out, and older machines would run a bit faster after it. I'd love to flush it out on this work machine I use (pent 2, mepis 3.3)

ideas?
 
Old 04-28-2005, 01:55 PM   #2
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
ive allways just opened ~2000 photos at the same time.. That about fills my gig of RAM and 2 gigs of swap.. (; Tho the even when I need this is very rare. Linux has superior memory management whem compared to other OS:s, so there realy isnt any need to flush the whole ram&swap. If you see 'free' reporting low values, dont forget that many apps like to cache memory, so most of the memory thats missing from free, isnt in use. Freeing cached memory for use by another app isnt strategically slower than using free mem.

Thats just my thoughts on the matter, I know it doesnt answer your question too well.. (;
 
Old 04-28-2005, 02:26 PM   #3
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Original Poster
Rep: Reputation: 32
aah, but my memory is 192 and swap is 256 or so, and it seems that when they appear full in the System Monitor on my tray the whole thing runs slower...
 
Old 04-28-2005, 02:31 PM   #4
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
open up a terminal and type:
Code:
free -m
What do you get, could you please post it here? Just to see if the memory is actually in use, and not just cached.
 
Old 11-10-2005, 04:02 AM   #5
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
Backup DB use all my Memory

Dear All,
I have same enquiry too.

During I'm tar my oracle database data file, all memory is used (Even after tar program).

my situatio is:-

daily cron doing this thing.

/etc/init.d/compiere stop (My ERP Services)
/etc/init.d/dbora stop (Oracle database)
tar cvfz $DATE.oracle.tar.gz /$PATH/TO/ORACLE/DATA/
/etc/init.d/dbora start (Oracle database)
/etc/init.d/compiere start (My ERP Services)

tar cvf /dev/nst0 $DATE.oracle.tar.gz


after the tar process, the result is:

[root@erp-svr cron.daily]# free
total used free shared buffers cached
Mem: 1554308 1550176 4132 0 8172 1302748
-/+ buffers/cache: 239256 1315052
Swap: 0 0 0


[root@erp-svr cron.daily]# free -m
total used free shared buffers cached
Mem: 1517 1513 4 0 7 1272
-/+ buffers/cache: 233 1284
Swap: 0 0 0


Th memory will keep in flush until I reboot the system.

Can somebody help me to clear the cache?

Regards,
Kstan
 
Old 11-10-2005, 08:32 AM   #6
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
Why would you want to clear the cache? Its mainly filled with files the kernel has cached for faster access. If the ram is needed, the cache will make way for the new data.

If you truly for some reason want to flush it, run something memory intensive that will take all the cached memory and then close that process, thus freeing the memory back again.

Generally speaking caching is a good thing, it doesnt realy slow memory allocation and files can be accessed by the kernel faster -> everything happens faster.
 
Old 11-11-2005, 12:23 AM   #7
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
Talking Clear Cache

Actually I forget to setup swap space, It cause my server run slowly. Now seems like the problem sove.http://images.linuxquestions.org/que...ons/icon10.gif
Talking

TQ
 
Old 11-11-2005, 01:12 AM   #8
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 257

Rep: Reputation: 36
I found a pretty good way to fill memory....

(and maybe crash your system..?)

If you have gnumeric, or another spreadsheet, simply open it up.

put into the 1st cell '88888888'

now copy this cell into to all of the cells below it, all the way down.

now you should have all of the cells in the 1st column filled with 88888888

now copy the entire column into each of the columns next to it; all the way across...

(ultimately, you're trying to fill every single cell in the spreadsheet...)

You'll see your memory fill up almost instantly, and unless you have lots of memory and
a fast machine; it may well crash.. !! or seem to...
 
Old 11-11-2005, 10:39 AM   #9
lefty.crupps
Member
 
Registered: Apr 2005
Location: Minneap USA
Distribution: Debian, Mepis, Sidux
Posts: 470

Original Poster
Rep: Reputation: 32
hm, thats interesting... you should file a bug about it. not that its bound to happen often, but I'm sure that they'd like to know!
 
Old 11-11-2005, 12:46 PM   #10
rodeoclown
Member
 
Registered: Feb 2003
Posts: 44

Rep: Reputation: 15
Should never be a reason to clear out physical RAM usage.. but if you have swap files in place but not being used.. a simple:

swapoff /swap/device-or-file

then

swapon /swap/device-or-file

Should clear it out...
 
Old 11-18-2005, 02:53 AM   #11
danimalz
Member
 
Registered: Jul 2005
Location: West Coast South, USA
Distribution: debian 3.1
Posts: 257

Rep: Reputation: 36
Quote:
Originally posted by rodeoclown
Should never be a reason to clear out physical RAM usage.. but if you have swap files in place but not being used.. a simple:

swapoff /swap/device-or-file

then

swapon /swap/device-or-file

Should clear it out...
I dunno. Have u tried this? When i've done it (im running a pretty robust machine...), the system
can slow down to the point where you cannot get to a shell. If I could have, I would've just killed
the whole gdm session.
 
Old 11-18-2005, 04:31 AM   #12
Artanicus
Member
 
Registered: Jan 2005
Location: Finland
Distribution: Ubuntu, Debian, Gentoo, Slackware
Posts: 827

Rep: Reputation: 31
I tried that out and the results very pretty disastrous if I had even one byte of swap in use when deactivating it. I managed to save my testmachine by doing a swapon eventhough the swapoff wasnt fully finihed yet.. Was running out ram quick.. d:

I dont recomend taking swap off to clear anything.. There realy is no use in clearing memory unless some areas are better than others, and if thats the case, its time to swap the ram.. d:
 
Old 11-18-2005, 08:26 AM   #13
Keruskerfuerst
Member
 
Registered: Oct 2005
Location: Lat: 482356N, Lon: 104145E
Distribution: Gentoo 2006
Posts: 719

Rep: Reputation: 31
on console:
"sync" writes changed files back to HDD.
 
Old 06-02-2006, 12:25 PM   #14
sufi
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
how 2 clear RAM cache

hi,plz help me 2 clear RAM cache,i use 2gig of RAM,when i use asterisk an open source PBX,after few hour it shows ram usage as 99%. where cache on ram is 1.6 gigs
 
Old 06-02-2006, 01:26 PM   #15
sufi
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
plz help me 2 flush unnessery cache from ram
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail, command to flush queue? glock19 Linux - Software 10 11-18-2010 11:23 PM
how to reload sbp2 module /Flush terminal command cache Lakota Mandriva 1 12-07-2004 02:08 PM
Use RAM as swap??? oneandoneis2 Linux - General 3 08-19-2004 04:48 AM
RAM and Swap shiny_spoon Linux - General 5 01-13-2004 02:27 PM
Swap and RAM ? mikeshn Linux - General 1 09-18-2002 09:33 PM


All times are GMT -5. The time now is 04:26 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration