mysqlmemorymemory-leakshtop

Memory report confusion shown by top and htop commands?


I'm on Slicehost 256 plan running one single Rails app on Ubuntu Hardy 64 bit server.

This is the shot taken using top command sorted by memory% (Shift+M) Memory by top http://www.freeimagehosting.net/uploads/7d35d548bf.png

And this is the screenshot taken while running htop command sorted by memory% used. Memory by htop http://www.freeimagehosting.net/uploads/f598fea0da.png

The memory consumed by mysql using top shows 3.8% but the htop shows around 17 processes each eating up around 3.2% of memory.

Whats the difference between those stat shown by top and htop??

Is mysql eating up my memory as shown by htop??


Solution

  • It looks like htop defaults to showing you the threads view. You can get the same effect in top by pressing shift-H. There is one mysql process using 3.2% memory and 17 threads.

    Alternatively, you can make htop display only a single line per process, like the default behavior in top.