We are working on OEL5.7 (Oracle Linux) OS. We have a server with 64GB RAM. When we issue free -m command which shows the used, available and cached space. Most of the space is shown in cached section, where as we are not really doing much activity on the server.
It's like cached is somewhere around 23GB, how can we see what is in it which is cached and how do we clear it?
You are having the standard Linux Newbie Memory Freakout. Cache memory counts as free memory.
Linux uses every spare bit of memory to cache all disk accesses, because memory which sits around doing nothing is useless. But cache will be recycled for other uses as needed. It's only sitting around as cache right now because it's not needed. Large amounts of cache are to be expected on an unloaded and idle system.
You want to have at least some cache, anyway. If you use so much memory that there's nothing left for cache, this is a problem -- disk access will become slow. The more cache you have, the more efficient disk access can become.
Do not, repeat, do not reboot your system, plug weird values into /proc/ to "flush the cache", and so forth. Everything is fine.
Why would you want to clear it? The cache is available as free memory if an application requires it. This is a better use of memory in case you need to recall the contents of a file that has been read.
Yes, the only time you really want to drop caches (all right, the one time I can think of right now) is if you are testing disk read performance for comparison. Then you do want to drop caches so as to make the tests equal.