What is all this memory used for?

Posted October 10, 2018 3.2k views
Server OptimizationDigitalOceanUbuntu 16.04

In Virtualmin I got an overview of my running processes. I thought my 2GB server was more than enough - for application I use 512M is the recommended minimum. But when I see the statistics much of those 2GB is used. What is happening? Why is Digital Ocean consuming so much itself?

Real memory: 1.97 GB total / 993.90 MB free / 726.32 MB cached

1597 root 835.54 MB /usr/lib/snapd/snapd
1743 nobody 775.73 MB /opt/digitalocean/bin/do-agent -log_syslog
1621 clamav 598.76 MB /usr/sbin/clamd –foreground=true
1789 mysql 556.29 MB /usr/sbin/mysqld
1250 www-data 229.91 MB /usr/sbin/apache2 -k start
1251 www-data 229.80 MB /usr/sbin/apache2 -k start

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

I suspect those values are virtual memory usage not the actual memory being used right now. The difference is that, for example, the 835MB snapd is using includes the shared libraries, plus memory that’s been swapped out, and unused memory. You’ll need to run top like this from the command line to figure out the exact memory usage:

top -oRES -b -n1 |grep 'snapd\|do_agent\|clamd\|mysqld\|apache2'

Thank you for your answer. That explains a lot. It leaves one question: why is Digital Ocean using so much?

  • Virtualmin’s showing do_agent is using 775.73 MB of virtual memory. That’s a lot but try to find out how much physical memory it’s using:

    top -b -n1|grep do_agent

    The 5th column will show you the physical memory in bytes.