I have an rails 3 application with 100-200 daily unique visitors. The total memory consumed on the server(Ubuntu) is around 1.5-2 GB. I want to know how much memory is used by each process. What are the best tools to track memory used by different processes?
migrated from stackoverflow.com Oct 12 '11 at 2:59
This question came from our site for professional and enthusiast programmers.
You could just fire up
You could run
You could enable snmp and configure mrtg to periodically poll the system, generating a graph of how much memory is used by the processes you care about.
You could resign yourself to the knowledge that Ruby, for all its benefits, is terrible at managing memory in long-running processes. :)
You could combine a more complicated ps command line (look at the man page, and read about the -o option) and
Memory management is very difficult, but you can use
But it is common for processes to consume less memory than they use. For instance, if you have ten processes using 10MB each, that does not mean those processes will consume 100MB. The reason for this is that Linux will recognize identical memory portions between processes so you don't need to have many identical copies. In other words, your system can always use more memory than you have. So you really need to separate between memory consumption and memory usage.
It's not always easy.