2

I have the same software suite with roughly similarly sized datasets on two Debian 9 systems, with one big difference: os-1 runs on bare-metal and has better hardware, while os-2 is virtualized through VMWare, with somewhat less resources available.

During operation, while trying to break down overall memory usage into what each piece of software is using up, I've reached a point where I am not able to correlate the memory usage reports from the two OS'es anymore. In particular:

"top" and "free -m" on os-1

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
15451 mysql     20   0 9127356 998548 157856 S   0.0  2.4   3246:27 mysqld                                           
   42 root      20   0  271064 176612 176332 S   0.0  0.4  42:19.55 systemd-journal                                  
21979 mongodb   20   0 1616012 129260  35476 S   0.5  0.3 340:30.57 mongod                                           
  130 Debian-+  20   0  126644  78248   5820 S   0.0  0.2  83:17.46 snmpd                                            
  896 root      20   0  370140  36400  28452 S   0.0  0.1   3:06.93 apache2                                          
 1523 www-data  20   0  370212  11472   3480 S   0.0  0.0   0:00.00 apache2

# free -m
              total        used        free      shared  buff/cache   available
Mem:          40000        1131       32612        2398        6256       38868
Swap:          8191          85        8106

"top" and "free -m" on os-2

   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                         
 62285 mysql     20   0 2893200 690956      0 S   0.3  8.5  14097:36 mysqld                                          
 79420 mongodb   20   0 1815116 320700   2300 S   0.7  3.9 245:25.68 mongod                                          
104939 www-data  20   0  445412  39284  16596 S   0.7  0.5   0:21.56 apache2                                         
 97338 www-data  20   0  444964  38704  16480 S   0.3  0.5   0:41.19 apache2                                         
 97313 www-data  20   0  444836  38504  16416 S   0.7  0.5   0:40.33 apache2                                         
 97315 www-data  20   0  444636  38476  16608 S   0.7  0.5   0:42.21 apache2                                         
110249 www-data  20   0  444628  38236  16076 S   0.3  0.5   0:12.58 apache2      

# free -m
              total        used        free      shared  buff/cache   available
Mem:           7969        6067        1170          88         731        1571
Swap:          2927           0        2927

Based on my following observations:

  • os-1's reporting indicates that the overall usage is roughly the sum of its processes' RSS numbers (i.e. ~1.1GB), and NOT their VSZ'es, which would equate to over 11 GB of "used" memory. Fair enough, let's move on!
  • os-2's reporting indicates that the overall usage is a much larger number than the sum of its processess' RSS values (6GB?!). A number which I cannot explain anymore.

... what would be a next step in order to explain the root cause of the reported high memory usage on os-2? Are there any critical memory-related virtualization concepts that I've omitted while drawing these conclusions? Thank you!

Your Answer

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

Browse other questions tagged or ask your own question.