What is the difference between VIRT and RES?

The difference between VIRT and RES in the context of the top command is as follows:

  • VIRT (Virtual Memory Size): This represents the total amount of virtual memory that a process can access. It includes all types of memory that the process can use, such as:

    • Code segments
    • Data segments
    • Shared libraries
    • Memory that has been swapped out
    • Memory that is allocated but not currently used
  • RES (Resident Memory Size): This indicates the portion of the process's memory that is currently held in RAM (physical memory). It does not include memory that has been swapped out to disk or memory that is allocated but not currently in use. RES reflects the actual physical memory usage of the process at that moment.

In summary, VIRT includes all memory that a process can potentially use, while RES shows only the memory that is actively being used and is resident in physical RAM.

0 Comments

no data
Be the first to share your comment!