Why Linux Memory Cached Very Big?


I have been using Redhat AS 4 Upd 6. And An application working on the this server and database Oracle.

This server have 12 gb memory. But Application using very low memory but memory cache very big. I am attaching a screen shot as top command export. You can see ram usage.

What are you thinking? Why I see ram using very big?

Also, How can i clean chace memory size? Is this chache clean can be reason any problem on the Application or Oracle Database?
Who is Participating?
fosiul01Connect With a Mentor Commented:
Caching memory is a good thing
this is a good thing about linux

it try to utilize most of your ram. if you give it another 20GB of ram you will see it cached most of the , it makes your application faster , as it cached everything on the ram, so it will not have to go to hardrive for information

when it will see you need more ram, it will automatically releases ram from cached and insert new informaiton on that

so dont worry about it, its a good think, if it would not cache , then i would of worry about why its not caching

Just make sure that your system is not swapping.

you can use

free -m command

and look at

-/+ buffers/cache:        

to find out how much free ram you got, you need to add both column,

ygouthamConnect With a Mentor Commented:
you cannot clean cache memory.

total RAM in system = RAM used + Cached memory

you would understand the same from the command


see which programs are using up most of the memory and then try to see if you can fine tune any of those services
LMiller7Connect With a Mentor Commented:
Any modern operating system will always attempt to find some use for as much memory as possible, even if it is only of trivial value. Unused memory is wasted memory. Any use of memory, almost anything at all, is better than no use.

Freeing memory is a very simple and fast operation. In contrast to this, loading data from disk is a complex and very time consuming operation. An intelligently designed system will try to avoid this whenever possible. It does this with caching. Whenever data is read from or written to disk the system also try to keep a copy in memory in the event that it may be needed again. If it is you have saved a great deal of time. If it is not and the memory consumed by the cache is needed for other purposes it can be quickly freed.

The system will try to use as much memory as possible for caching. This is a good thing, a very good thing. Don't try to fight it, let it work for you.
coandaConnect With a Mentor Commented:
I agree with the previous comments stating that nothing is wrong if your cache is quite large, however, this is how to clear cache in Debian based distros:

$ sync
$ echo 3 > /proc/sys/vm/drop_caches

I should mention though that this can cause you to lose data, etc... and should never be done on a production server.

I don't have an install of RH so I don't know if the drop_caches file even exists in them, but there you go.
To put it another way.
Unused memory = Cache memory + Free memory.

Check the Oracle documentation to make sure it's configured correct for the amount of data in your database.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.