1e41f4b71Sopenharmony_ci# vmm
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Command Function
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciThis command is used to query the virtual memory used by a process.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci## Syntax
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci- vmm [_-a / -h / --help_]
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci- vmm [_pid_]
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci## Parameters
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci**Table 1** Parameter description
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci| Parameter| Description| Value Range| 
21e41f4b71Sopenharmony_ci| -------- | -------- | -------- |
22e41f4b71Sopenharmony_ci| -a | Displays the virtual memory usage of all processes.| N/A | 
23e41f4b71Sopenharmony_ci| -h \| --help | Displays help information.| N/A | 
24e41f4b71Sopenharmony_ci| pid | Specifies the ID of the process to query.| [0, 63] | 
25e41f4b71Sopenharmony_ci
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci## Usage Guidelines
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ciBy default, this command displays the virtual memory usage of all processes.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci## Example
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ciRun **vmm 3**.
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci## Output
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ciVirtual memory usage of process 3:
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci```
42e41f4b71Sopenharmony_ciOHOS # vmm 3
43e41f4b71Sopenharmony_ci PID    aspace     name       base       size     pages
44e41f4b71Sopenharmony_ci ----   ------     ----       ----       -----     ----
45e41f4b71Sopenharmony_ci 3    0x408c0118 foundation 0x01000000 0x3e000000     800
46e41f4b71Sopenharmony_ci         region      name                base       size       mmu_flags      pages   pg/ref
47e41f4b71Sopenharmony_ci         ------      ----                ----       ----       ---------      -----   -----
48e41f4b71Sopenharmony_ci         0x408cb364  /bin/foundation                  0x06da3000 0x00001000  CH US RD          1       1
49e41f4b71Sopenharmony_ci         0x408cb80c  /bin/foundation                  0x06da4000 0x00001000  CH US RD EX       1       1
50e41f4b71Sopenharmony_ci         0x408cb720  /bin/foundation                  0x06da5000 0x00001000  CH US RD          1       1
51e41f4b71Sopenharmony_ci         0x408cb9a8  /bin/foundation                  0x06da6000 0x00001000  CH US RD WR       1       1
52e41f4b71Sopenharmony_ci         0x413efde4  HEAP                             0x12b43000 0x00015000  CH US RD WR      19      19
53e41f4b71Sopenharmony_ci         0x408c3d34  /lib/libc.so                     0x23b08000 0x0004a000  CH US RD         25       2
54e41f4b71Sopenharmony_ci         0x408cbd44  /lib/libc.so                     0x23b52000 0x00068000  CH US RD EX      58      10
55e41f4b71Sopenharmony_ci         0x408c3dc0  /lib/libc.so                     0x23bba000 0x00002000  CH US RD WR       2       2
56e41f4b71Sopenharmony_ci         0x408cc128  /lib/libc.so                     0x23bbc000 0x00002000  CH US RD WR       2       2
57e41f4b71Sopenharmony_ci         0x408d1634  MMAP                             0x23bbe000 0x00005000  CH US RD WR       5       5
58e41f4b71Sopenharmony_ci         0x408c4e10  VDSO                             0x23bc3000 0x00002000  CH US RD EX       2       2
59e41f4b71Sopenharmony_ci         0x408dbaec  /lib/libc++.so                   0x23bc5000 0x00046000  CH US RD         51       5
60e41f4b71Sopenharmony_ci         0x408deba8  /lib/libc++.so                   0x23c0b000 0x0009f000  CH US RD EX      29      10
61e41f4b71Sopenharmony_ci         0x408debf4  /lib/libc++.so                   0x23caa000 0x00006000  CH US RD          6       6
62e41f4b71Sopenharmony_ci         0x408c3ce0  /lib/libc++.so                   0x23cb0000 0x00001000  CH US RD WR       1       1
63e41f4b71Sopenharmony_ci```
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ci**Table 2** Basic process information
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ci| Parameter| Description| 
68e41f4b71Sopenharmony_ci| -------- | -------- |
69e41f4b71Sopenharmony_ci| PID | Process ID.| 
70e41f4b71Sopenharmony_ci| aspace | Address of the virtual memory control block.| 
71e41f4b71Sopenharmony_ci| name | Process name.| 
72e41f4b71Sopenharmony_ci| base | Start address of the virtual memory.| 
73e41f4b71Sopenharmony_ci| size | Total Virtual Memory.| 
74e41f4b71Sopenharmony_ci| pages | Number of used physical pages.| 
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci**Table 3** Virtual memory interval information
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci| Parameter| Description| 
79e41f4b71Sopenharmony_ci| -------- | -------- |
80e41f4b71Sopenharmony_ci| region | Address of the control block in the virtual memory region.| 
81e41f4b71Sopenharmony_ci| name | Name of the virtual memory region.| 
82e41f4b71Sopenharmony_ci| base | Start address of the virtual memory region.| 
83e41f4b71Sopenharmony_ci| size | Size of the virtual memory region.| 
84e41f4b71Sopenharmony_ci| mmu_flags | MMU mapping attribute of the virtual memory region.| 
85e41f4b71Sopenharmony_ci| pages | Number of used physical pages, including that of the shared memory.| 
86e41f4b71Sopenharmony_ci| pg/ref | Number of used physical pages.| 
87