1

I am running web and DB on a single server with 4GB ram. When I checked memory using free -m I can see most of the memory is in cached.

free -m
              total        used        free      shared  buff/cache   available
Mem:           3534        1507         973          25        1052        1676
Swap:          8191           0        8191

Is there any way to find out which process is served from cache or which are getting a cache, because everytime I have to use sync command to clear free memory.

0

In general you should not do that. Free memory is unused memory, a wasted resource. The kernel knows what it's doing: as long as there is no better use for memory it will use it for I/O buffers or disk cache. When a process more memory will be needed for running processes then the kernel will automatically allocate it.

Unless you can measure an imbalance between the use of swap space and memory you should not interfere with the memory allocation parameters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.