• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How to Check CPU Memory Usage in Linux Ubuntu

How to Check CPU Memory Usage in Linux Ubuntu

By Sourabh / December 23, 2020 Category: How To, Ubuntu

CPU and memory utilization command in Linux to check process memory usage in Linux Ubuntu. This post is all about how to check which process is using more memory in Linux system.

top

top is used to display Linux processes. It provides a dynamic real-time view of a running system. It displays system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The top command provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration.

Two of the most important factors displayed by the top command are:

  1. %CPU — CPU Usage: The task’s share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if a process is multi-threaded and top is not operating in Threads mode, amounts greater than 100% may be reported.
  2. %MEM — Memory Usage (RES): A task’s currently used share of available physical memory.

If you want to make top a bit more memory-friendly, issue the command top -o %MEM, which will cause top to sort all processes by memory used (see figure below).

free

The free command is used to display amount of free and used memory in the system. The command also displays the total amount of swap memory in the system and buffers and caches used by the Linux kernel. The information is gathered by parsing /proc/meminfo.

The command option displays:

  1. total: Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
  2. used: Used memory (calculated as total – free – buffers – cache)
  3. free: Unused memory (MemFree and SwapFree in /proc/meminfo)
  4. shared: Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available on kernels 2.6.32, displayed as zero if not available)
  5. buffers: Memory used by kernel buffers (Buffers in /proc/meminfo)
  6. cache: Memory used by the page cache and slabs (Cached and Slab in /proc/meminfo)
  7. buff/cache: Sum of buffers and cache
  8. available: Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)

/proc/meminfo

Much of the information in /proc/meminfo is used by the free, top, and ps commands. In fact, the output of the free command is similar in appearance to the contents and structure of /proc/meminfo. However, /proc/meminfo itself has more details:

  • MemTotal — Total amount of usable RAM, in kibibytes, which is physical RAM minus a number of reserved bits and the kernel binary code.
  • MemFree — The amount of physical RAM, in kibibytes, left unused by the system.
  • Buffers — The amount, in kibibytes, of temporary storage for raw disk blocks.
  • Cached — The amount of physical RAM, in kibibytes, used as cache memory.
  • SwapCached — The amount of memory, in kibibytes, that has once been moved into swap, then back into the main memory, but still also remains in the swapfile. This saves I/O, because the memory does not need to be moved into swap again.
  • Active — The amount of memory, in kibibytes, that has been used more recently and is usually not reclaimed unless absolutely necessary.
  • Inactive — The amount of memory, in kibibytes, that has been used less recently and is more eligible to be reclaimed for other purposes.

and many more info.

Primary Sidebar

Latest Posts

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

Linux Command To Check RAM Size In Ubuntu Terminal In GB

How To Install Proprietary Drivers In Linux Ubuntu Using Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap