• RSS
  • subscribe
  • twitter

Linux Tips: Who is using the RAM

When the Pc is unexpectedly slow its difficult to know what program is slowing it down. It could be the many processes in execution, or insufficient RAM or excessive use of the virtual memory (the swap)
The fastest way to diagnose this situation is to verify how the system is using the RAM. The free command displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache consumed by the kernel.

The free command has many flags; -b, -k, -m or -g. These flags have in common the same objective , to change the units of measurement with which to show the data (byte, Kbyte, Mbyte and Gbyte) e.g

~$ free -m

The -s flag, followed by a number indicates the number of seconds that free would continuously display the data. Finally with the -t option, free displays the total value (free and used) of the memory in general; physical memory (the RAM), virtual memory (the swap partition)

IF the RAM is really crowded, then there are two things to be done;
1)Try to reduce the RAM consuming Services or get more RAM
2)A fast remedy is increasing the swap space to permit more dumping from the RAM. In Linux 512MB of RAM seem to be 1024 RAM unlike in Windows where 512MB practically become something like 212MB. So the Swap has a good rule to play in Linux. (Welcome to the Linux world where you are bound to spend less) Spending one half or one percent of your disk on swap can probably improve performance.
The best remedy, of course is getting more RAM. 🙂