In Ubuntu, managing RAM is crucial for optimal system performance. Whether you need to identify the total installed RAM, monitor usage, or check for errors, Ubuntu provides convenient tools through the Terminal application. You can access the Terminal using the Ubuntu Application launcher search bar or the Ctrl+Alt+T shortcut.
Checking Installed, Used, and Available RAM
Method 1: The free command.
To quickly assess memory statistics, the ‘free’ command proves invaluable. Without any additional switches, the basic usage is:
free
However, for a more readable format with memory and swap utilization displayed in a user-friendly, near three-digit format, utilize the ‘-h’ switch:
free -h
In the output, the “Mem” section provides details about your system’s RAM. The ‘total’ column indicates the total GBs of installed RAM, while ‘used’ and ‘available’ columns specify the RAM in use and the available GBs for further utilization.
Method 2: The vmstat command
To delve into comprehensive memory statistics using the vmstat command, employ the following syntax:
vmstat -s
By appending the -s flag, you unlock detailed insights into memory usage, enabling a thorough examination of your system’s memory performance.
Method 3: The /proc/meminfo command
To access dynamic insights into the system and kernel’s memory-related details, the following command navigates the /proc file system:
cat /proc/meminfo
Unlike traditional system files, the /proc files contain dynamic, real-time data about the system and kernel status.
Identifying RAM Type and Speed
To delve into more detailed information about your RAM, the ‘dmidecode’ command, executed with sudo privileges, proves invaluable. Begin by ensuring the necessary commands are installed:
sudo apt install dmidecode less
Next, use ‘dmidecode’ to examine RAM type:
sudo dmidecode --type memory | less
Enter the sudo password when prompted, and navigate through the displayed information. Locate the highlighted section indicating the RAM type (e.g., DDR3).
Moreover, within the same command, discover the Clock Speed of your RAM. Navigate through the output and use the ‘q’ key to exit.