What command is used to view virtual memory in Linux?

Release: 2020-03-09 08:47:29
Original
6694 people have browsed it

What command is used to view virtual memory in Linux?

#Linux uses the vmstat command to view virtual memory.

vmstat is the abbreviation of Virtual Meomory Statistics, which can monitor the virtual memory, process, and CPU activities of the operating system. It collects statistics on the overall situation of the system. The disadvantage is that it cannot conduct in-depth analysis of a certain process.

By default, the vmstat command is not installed. You need to install the sysstat package, which contains the vmstat program.

Basic parameters:

vmstat [-a] [-n] [-t] [-S unit] [delay [ count]]
Copy after login

[-a]: display Active and inactive memory

[-n]: Only display the field name once at the beginning, and output a more humane value for multiple collections of information

[-t]: In each item At the end of the information, the time when the information was collected is displayed

[-S unit]: Display using the specified unit. The parameters are k, K, m, and M, which represent 1000, 1024, 1000000, and 1048576 bytes respectively. The default unit is K (1024 bytes)

[delay [count]]: delay is the information collection interval, and count is the number of information collection times.

vmstat [-s] [-n] [-S unit]
Copy after login

[-s]: Display memory-related statistical information

vmstat [-m] [-n] [delay [ count]]
Copy after login

[-m]: Display slabinfo, which is recorded in the /proc/slabinfo file. Slab is a memory allocation mechanism in Linux.

vmstat [-d] [-n] [delay [ count]]
Copy after login

[-d]: Display statistical information of related disks

Note: This is different from the statistical information of -p downstairs. The statistical object is the disk -p is a subpartition. This cannot specify all output

vmstat [-p disk partition] [-n] [delay [ count]]
Copy after login

[-p disk partition]: Displays the statistical information of disk sub-partitions, which is not as useful as iostat information

vmstat [-f]
Copy after login

[-f]: The statistics since booting Number of forks

Note: The fork here should be the fork() function of the kernel. In the parent process, fork returns the process ID of the newly created child process

The above is the detailed content of What command is used to view virtual memory in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!