Target Control Debugging: mi Command (Compact 2013)
3/26/2014
This command displays memory information.
Syntax
mi kernel | full
Parameters
- kernel
Displays the kernel memory detail.
- full
Displays a set of tables that show the virtual memory usage for all of the processes in the system. The table is made up of ASCII characters that represent what each virtual page is being used for.
Remarks
You can enter the command in two ways:
- If the OS on your device supports the console window, you can bring up the Target Control window on your device by running shell -c. You can then enter the mi command at the shell command prompt on your device.
- If you use Platform Builder, you can enter the mi command from the Visual Studio Target Control window.
You can use the mi command in three different ways: with no parameter options, with the kernel option, and with the full option, as shown in the following examples.
Use the mi command with no parameter options (mi), as shown in the following output example:
Windows CE Kernel Memory Usage Tool 0.2 Page size=4096, 221788 total pages, 219620 free pages. 219609 MinFree pages (8880128 current bytes, 8925184 MaxUsed bytes) 89 pages used by kernel, 0 pages held by kernel, 2168 pages consumed. PROC: Name PID AcctId VMBase CurZone P00: NK.EXE 00400002 00000000 80220000 00000000 P01: shell.exe 01bf000a 00000000 00010000 00000000 P02: udevice.exe 014e001a 00000000 00010000 00000000 P03: udevice.exe 019c002a 00000000 00010000 00000000 P04: GweUser.exe 03d90006 00000000 00010000 00000000 P05: explorer.exe 02890012 00000000 00010000 00000000 P06: dmsrv.exe 02a00012 00000000 00010000 00000003 P07: servicesd.exe 02550032 00000000 00010000 00000000 P08: ConmanClient3.exe 03e70056 00000000 00010000 00000000 Memory usage for Shared Heap: Memory usage for Process 'NK.EXE' pid 400002 Page summary: code=1180(41) data r/o=924 r/w=544 stack=138 reserved=4057 Memory usage for Process 'shell.exe' pid 1bf000a Page summary: code=176(0) data r/o=62 r/w=15 stack=2 reserved=72 Memory usage for Process 'udevice.exe' pid 14e001a Page summary: code=302(47) data r/o=62 r/w=42 stack=18 reserved=388 Memory usage for Process 'udevice.exe' pid 19c002a Page summary: code=168(0) data r/o=62 r/w=10 stack=3 reserved=102 Memory usage for Process 'GweUser.exe' pid 3d90006 Page summary: code=178(0) data r/o=62 r/w=8 stack=4 reserved=143 Memory usage for Process 'explorer.exe' pid 2890012 Page summary: code=633(24) data r/o=218 r/w=35 stack=9 reserved=240 Memory usage for Process 'dmsrv.exe' pid 2a00012 Page summary: code=440(24) data r/o=218 r/w=26 stack=2 reserved=154 Memory usage for Process 'servicesd.exe' pid 2550032 Page summary: code=355(24) data r/o=218 r/w=39 stack=7 reserved=246 Memory usage for Process 'ConmanClient3.exe' pid 3e70056 Page summary: code=273(31) data r/o=218 r/w=21 stack=7 reserved=181 Total R/W data + stack = 930
Use the mi command with the kernel option (mi kernel), as shown in the following output example:
Windows CE Kernel Memory Usage Tool 0.2 Page size=4096, 221788 total pages, 219619 free pages. 219609 MinFree pages (8884224 current bytes, 8925184 MaxUsed bytes) 89 pages used by kernel, 0 pages held by kernel, 2169 pages consumed. Inx Size Used Max Extra Entries Name 0: 16 3440 3584 144 215(224) ModList/STKLIST/LockList/Alias/CeLogEvent 1: 40 60120 61200 1080 1503(1530) API/Prxy/HData/KMod/Wdog/TokList 2: 64 4352 4352 0 68( 68) MapView/CeLogDLL 3: 96 226080 228384 2304 2355(2379) Crit/Evt/Sem/Mut/PgPool/FSMap/LockPrcList 4: 156 24180 24336 156 155(156) Module/StubThrd 5: 412 3708 4120 412 9( 10) Process 6: 336 33936 36288 2352 101(108) Thrd 7: 1024 0 0 0 0( 0) Maximum Total Used = 355816 Total Extra = 6448 Waste = 408
Use the mi command with the full option (mi full).
When you use mi full, the output shows information detailed in a line-marked page summary. The output displays one table per process in the system. Each line in a table represents 64K of virtual memory within a process, and the first hexadecimal number on each line indicates the base address of the virtual memory for each 64K chunk. The second number on each line, in parentheses, indicates the number of locked pages within the 64K chunk, and can generally be ignored.
When addresses are skipped within a table, it signifies that no pages are presently allocated in the entire 64K chunk. Following the first two numbers on a line is a series of ASCII characters, each representing a single page of memory within the line's 64K chunk.
The following table shows the memory information definitions that are included in the page summary.Character
Definition
<blank space>
Indicates a virtual page that is not currently allocated. Does not require a physical page.
-
Reserved.
C
Code pages in ROM. Does not require a physical page.
c
Code pages in RAM. Requires a physical page.
S
Indicates a virtual page that holds a stack. Requires a physical page.
P
Indicates a virtual page that is used to map a range of hardware addresses; that is, peripheral memory pages used to map target device memory by using VirtualAlloc.
Does not require a physical page. Peripheral memory may include frame buffer memory.
W
Indicates a virtual page that holds read-write data. Requires a physical page. Read-write pages include global variables as well as dynamically allocated memory.
O
Indicates a virtual page that the object store uses. Requires a physical page. Should only appear in the Filesys process.
?
Contents unknown.
r
Read-only data pages in RAM. Requires a physical page. Read-only data primarily comes from data items that are declared as a const type in the source code.
R
Read-only data pages in ROM. Does not require a physical page. Read-only data primarily comes from data items that are declared as a const type in the source code.
The following output example shows partial results from the mi command with the full option:
Memory usage for Process 'shell.exe' pid 1bf000a 00000000: -----r---------- 00010000: -CCCCCCCCCCCCCWW 00020000: - 00030000: --------------SS 00040000: WWW------------ 00050000: RRRRRRRRRRRRRRRR 00060000: RRRRRRRRRRRRRRRR 00070000: RRRRRRRRRRRRRRRR 00080000: RRRRR 00090000: RRRRRRR 000a0000: R 000b0000: WW 40000000: ---------------- 40010000: -CCCCCCCCCCCCCCC 40020000: CCCCCCCCCCCCCCCC 40030000: CCCCCCCCCCCCCCCC 40040000: CCCCCCCCCCCCCCCC 40050000: CCCCCCCCCCCCCCCC 40060000: CCCCCCCCCCCCCCCC 40070000: CCCCCCCCCCCCCCCC 40080000: CCCCWWCCC--- 40090000: -CCCCCCCCCCCCCCC 400a0000: WCCCCCCCCCCCCCCC 400b0000: CC- 400d0000: -CCCCW- 404c0000: -CW- 404e0000: -CWC- 404f0000: -CCCCCCW- Page summary: code=176(0) data r/o=62 r/w=14 stack=2 reserved=73