Linux has a well working memory management. Generally it’s not necessary to adjust something manually. You can see the used and free space with the free command.

# free -m
             total       used       free     shared    buffers     cached
Mem:           970        376        593          0         99        102
-/+ buffers/cache:        174        795
Swap:          511          0        511

If there is free memory space it can be used as cache for faster access. Some times it’s interesting how much memory is really used and how much could be free. In this case you can drop the cache.

# echo 3 > /proc/sys/vm/drop_caches
# free -m
             total       used       free     shared    buffers     cached
Mem:           970         39        931          0          0          6
-/+ buffers/cache:         31        938
Swap:          511          0        511