I usually monitor my server resource usage. I am using htop for monitoring.

When running htop the memory usage is 1.3G, which is fine for me.

But I tried to view the memory used by each process. For this, I am using ps command. To view the memory used by MySQL, I am runing ps aux | grep mysqld.

It prints these lines:

root     13908  0.0  0.0 112660   972 pts/0    S+   11:12   0:00 grep --color=auto mysql
mysql    17984  2.6  3.1 2845500 387676 ?      Ssl   2017 2974:34 /usr/sbin/mysqld

So, it seems that MySQL uses 2845500 of memory, which means around 2.7G of memory, which is much higher than (1.3G) the full system memory usage showed by htop.

Is that the number shown by ps, a number of bytes, instead of kilobytes?

PS: I am using CentOS 7, 64 bit version.


2845500 is the amount of memory allocated by the process, not the amount it’s using. The latter is given by the next column: 387676. Both values are measured in kilobytes.

  • Oooh, thank you very much! I understand now. – MM PP Jan 10 '18 at 10:33

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.