Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16-02-2010
Member
 
Join Date: Nov 2009
Posts: 39
Clear Memory Buffer using script in Linux

Hello sir !

I have very simple question in my mind related to scripting in Linux.I am using oracle database and need to clear the memory buffer after specified interval.would you tell me which command is being used to clear the buffer memory.I want to specify a created script which contains this code and get execute automatically when the buffer size reached at its maximum.How would I do it .

Last edited by Ainsley : 16-02-2010 at 04:47 PM.
Reply With Quote
  #2  
Old 16-02-2010
Member
 
Join Date: Apr 2008
Posts: 3,291
Clearing Memory Buffer

Clearing Memory Buffer

The Linux provides a good memory management features with the cache memory feature.If you have more space of RAM and getting very slow processing during start up of database.Then it may be happen,you wouldn't configure the cache memory and the cache are being stored on the RAM and the startup files are also loaded on RAM.

In this case,the RAM get failed to execute processes at proper time.You can clear the occupied memory buffers using the following command :

Code:
sync; echo 3 > /proc/sys/vm/drop_caches
Reply With Quote
  #3  
Old 16-02-2010
Member
 
Join Date: Nov 2005
Posts: 3,023
Setting time interval using crontab

Setting time interval using crontab:

If you want to use the command at proper specified time,you can do it using crontab utility of linux which is very easily to use.You have to specify the exact time and date of execution.The crontab utility is used to execute job according to time interval.To perform a job in crontab is followed by this procedure,You need to edit the crontab file using the below command :
$ crontab -e
The syntax of crontab would be in this format

1 2 3 4 5 /path/to/command arg1 arg2
where 1:Minute,2: Hours (0-23),3: Day (0-31),4: Month (0-12),5: Day of the week(0-7) and next follow the command subscriptions

To perform the job,you need follow this way of time interval according to set up the job.
Reply With Quote
  #4  
Old 16-02-2010
Member
 
Join Date: May 2008
Posts: 2,676
Clear Memory Buffer using crontab job

Clear Memory Buffer using crontab job :

The procedure of clearing memory buffer,you can use crontab utility with time interval. An example is given in which I am going to set the time interval of executing the command permanently.

Code:
15 14 1 * * echo 3 > /proc/sys/vm/drop_caches
This statement in the crontab file would be Run at 2:15pm on the first of every month means the corresponding command would execute automatically to clear the buffer at specified time.
Reply With Quote
  #5  
Old 16-02-2010
Dr. V
 
Posts: n/a
Creating basic script in linux

Creating basic script in linux :

The shell script is a program which is written in shell programming language and executed by a shell process.It is useful for performing automatic task with the reference of your file.

I am going to create a script in the following procedure :

open a text editor (but not a word processor) like gedit or vi and type some shell contents which will print "Hello world ".

Code:
 #!/bin/bash
    clear
    echo "Good morning, world."
Save this file with the .sh extension and execute it on the prompt with the path specified and change the permission setting otherwise cause some error.
Reply With Quote
  #6  
Old 16-02-2010
Member
 
Join Date: Jan 2008
Posts: 3,384
Clear Memory Buffer using script in Linux

Clear Memory Buffer using script

You can specify the name of file in the command section on crontab job list.specify the time and locate the path of file which you want to execute.
Create a script and write the code of clearing buffer memory and put it with the time as an argument.

The code would be as follows :

15 14 1 * * <Path of the script file name>
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Clear Memory Buffer using script in Linux"
Thread Thread Starter Forum Replies Last Post
Mouse wheel volume control and video buffer in Linux VLC Montana Windows Software 8 26-09-2010 02:59 AM
Stack based buffer; Physical Memory Dump; Blue Screen of Death Hel Kool MediaCenter 3 10-05-2010 12:14 AM
Setting depth buffer (z buffer) size (16bit / 24bit) NewComer Monitor & Video Cards 4 08-04-2010 05:47 AM
How To Clear Your Computer Memory Jannat Tips & Tweaks 3 15-06-2009 10:47 PM
How do I increase my Buffer Cache Memory John John Windows XP Support 1 06-07-2007 06:13 AM


All times are GMT +5.5. The time now is 12:36 AM.