BM Balmiki Mandal 04 May 2023 1 views 0 comments Linux

Getting to Know the Vmstat Command in Linux

What is Vmstat Command in Linux?

The vmstat command in Linux is a tool that provides information about virtual memory statistics. It displays figures on processor, memory, page, swap, IO and system activities as well as interrupts since the last reboot.

How to Use Vmstat Command?

The general syntax to use the vmstat command is:

vmstat [options] [delay [count]]

Where "delay" specifies the delay in seconds between each update of the report and "count" is the number of times the report should be generated. If not specified, the default values are "1" for delay and "infinity" for count.

Examples of Vmstat Command

Typing "vmstat" without any options will generate a report of the current system activity.

$ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st 
 0  0      0 304884  70764 148356    0    0     6    32   71   80  5  1 94  0  0

The "vmstat 1 5" will generate 5 updates of the report every second.

$ vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st 
 0  0      0 308548  70960 147424    0    0     0     6   24   28  4  1 95  0  0
 0  0      0 308612  70960 147432    0    0     0     0  425  455  0  0 100  0  0
 0  0      0 308612  70960 147432    0    0     0     0   54   55  0  0 100  0  0
 0  0      0 308612  70960 147432    0    0     0     0   34   36  0  0 100  0  0
 0  0      0 308612  70960 147432    0    0     0     0   53   57  0  0 100  0  0

Conclusion

Thus, the vmstat command in Linux is an important tool for monitoring virtual memory statistics. It is useful for detecting memory leakage, performance issues etc.

0 Comments

No comments yet, Be the first to comment.

Post a Comment

Please sign in to post a comment.

Related Posts

How to Create an Embedded Linux Development Environment on Windows Using WSL2

 Creating an Embedded Linux Development Environment on Windows Using WSL2If you are learning Embedded Linux, y...

AG Anvesh G 05 Sep 2026
Installing Ubuntu OS in Window Using VirtualBox

Installing Ubuntu on Windows Using VirtualBoxSteps:-1. Download and Install VirtualBox Download VirtualBox fr...

BM Balmiki Mandal 18 Jan 2025
Kali Linux 2021.4, Apple M1 support, armhf, arm64, Electro4u

Kali Linux 2021.4 Brings Improved Apple M1 Support Kali Linux, the world’s premier open-source penetration te...

BM Balmiki Mandal 06 Jun 2023