I am using top
to monitor my server. The swap row reads
Swap: 1044220k total, 0k used, 1044220k free, 148544k cached
I have hit O
p
to sort by swap.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ SWAP COMMAND
703 mysql 20 0 930m 43m 7092 S 0 8.9 0:00.66 886m mysqld
1555 www-data 20 0 346m 9792 3208 S 0 2.0 0:00.00 337m apache2
1559 www-data 20 0 347m 10m 3712 S 0 2.2 0:00.01 336m apache2
1567 www-data 20 0 345m 9448 2552 S 0 1.9 0:00.01 336m apache2
1557 www-data 20 0 345m 9452 2556 S 0 1.9 0:00.01 336m apache2
1562 www-data 20 0 345m 9508 2344 S 0 1.9 0:00.01 336m apache2
1566 www-data 20 0 345m 9684 2684 S 0 1.9 0:00.02 335m apache2
I was wondering how I should read this. Is this the swap available to these processes?
This morning top displayed mysqld was using 1.1 gb of swap and 30% of my swap was used up. AFter throwing more ram at the machine mysqld
is down to 886m
and top says swap usage is 0 (that math seems to makes sense). So I'm just wondering what is the swap column displaying?? Why doesn't the swap overview reflect the sum of the swap column?
Thank you.
Best Answer
It is calculated by subtracting physical memory from virtual memory:
man top
for more details: