To find out the amount of physical memory:

  dmidecode -t 17 | grep "Size.*MB"
  

To check memory utilisation:

  free -m

This will show the real memory utilsation for a Linux server (i.e. without the disk cache). Look at the +/- buffers line

To check the amount of memory each process is using:

  ps -e -o pid,vsz,comm= | sort -n -k 2
    

In the event of swap reservation bottlenecks, problems can be investigated as follows:

To check the current size and usage

  grep SwapTotal /proc/meminfo
  

vmstat can be used to check current swapping, e.g.

  vmstat 5 20
  

The si and so fields sjow swap in and swap out. If these are continuously high, especially so , you probably needto add more memory.

For historic stats you can check sar. Check /var/log/sa for the file relevant for the date you're investigating and then check the paging stats for that file, e.g.

  sar -W -f /var/log/sa/sa31
    
      12:00:01 AM  pswpin/s pswpout/s
      12:10:02 AM     33.34    576.34
      12:20:01 AM     59.79    265.59
      12:30:02 AM    133.72     46.29
      12:40:01 AM    145.71     79.22
      .....
  

Recent Changes