networked day to day technical issues


Linux memory management

Recently i noticed that when running top command if you enable the SWAP column and add all of the values on that column you will get at least more swap usage than what you can see when running free , vmstat or checking the header of the top command; but it may often happen that the sum of the SWAP column actually is larger than physical swap space. In the top output below you can observe that by adding the value of SWAP column for the first 5 rows you will have a value larger the the current swap usage (listed on the 4th row in the header)

I checked that top actually gets correctly the data from /proc/process-id/status ; and it does for each running process so i moved on to see how Linux does memory management.