LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   flush my swap/ram? command? (https://www.linuxquestions.org/questions/linux-general-1/flush-my-swap-ram-command-318138/)

lefty.crupps 04-28-2005 01:24 PM

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?

Artanicus 04-28-2005 01:55 PM

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.. (;

lefty.crupps 04-28-2005 02:26 PM

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...

Artanicus 04-28-2005 02:31 PM

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.

kstan 11-10-2005 04:02 AM

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

Artanicus 11-10-2005 08:32 AM

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.

kstan 11-11-2005 12:23 AM

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

danimalz 11-11-2005 01:12 AM

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... :)

lefty.crupps 11-11-2005 10:39 AM

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!

rodeoclown 11-11-2005 12:46 PM

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...

danimalz 11-18-2005 02:53 AM

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.

Artanicus 11-18-2005 04:31 AM

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:

Keruskerfuerst 11-18-2005 08:26 AM

on console:
"sync" writes changed files back to HDD.

sufi 06-02-2006 12:25 PM

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

sufi 06-02-2006 01:26 PM

plz help me 2 flush unnessery cache from ram


All times are GMT -5. The time now is 08:22 AM.