次の方法で共有


DevHealth Memory Use Tool (Compact 2013)

December 15, 2016

DevHealth is a memory-reporting tool that you run on a Windows Embedded Compact powered device with or without establishing a connection between your development computer and your device. By using DevHealth, you can take a snapshot of virtual memory and generate an overview of the memory footprint of the device. DevHealth produces text file reports that you read with a text file viewer. These reports include:

  • System Memory Report: Lists the amount of memory on the device and how it is being used.
  • System Memory Map Report: Shows the page types of the virtual memory that is being used by each process.
  • Process Report: Lists the number of pages of virtual memory that are being used by each process.
  • Module Report: Lists the number of pages of virtual memory that are being used by each DLL module.
  • Heap Report: Provides information on each heap that is being used by each process.
  • Dependency Report: Lists the module reference counts for all processes and DLL modules that are loaded into memory.

Use DevHealth to monitor the memory use of a device or as the starting point for investigations into memory leaks. For example, to monitor device or application memory use over a long period of time, run DevHealth at 15-minute intervals with the timer option. You can then analyze the individual output files. You can also use DevHealth for memory leak investigations by comparing DevHealth reports before and after a complex scenario. An unexpected increase in the program memory use may indicate potential memory leaks. Note that DevHealth reports memory use on a module-by-module and process-by-process basis and does not provide more specific details about individual memory allocations. However, this information may help you narrow down memory leaks to processes or modules. At that point, you can use other tools such as Remote Resource Leak Detector in Windows Embedded Compact Remote Tools Framework to find exactly where the memory leaks are located in the source code.

Other Windows Embedded Compact 2013 tools may generate data similar to what DevHealth generates. For example, you can use Performance Monitor in Remote Timeline Viewer or Remote Resource Consumer in Remote Tools Framework to monitor system memory use. The Target Control Debugging: mi Command in Platform Builder also generates memory map data. However, those methods require a connection between your development computer and your device, and they report less detailed memory use information than DevHealth. DevHealth is not designed to replace these other tools, but to provide an additional option. You should select your tool based on your needs.

Use DevHealth

DevHealth consists of two device-side files: the main program (Devhealth.exe) and a kernel DLL (Devhealthdll.dll). You can find these files on your development computer in %_WINCEROOT%\public\COMMON\oak\target\<CPU Type>\<Build Type>, where <Build Type> is checked, debug, or retail.

You can run DevHealth either from your device or from Platform Builder. If you want to run DevHealth from your device, you need to copy both Devhealth.exe and Devhealthdll.dll to the device. Because Devhealthdll.dll is a kernel DLL, copy it to the Windows directory on the device. If you plan to run the tool from the device with command-line options, include the Command Processor (SYSGEN_CMD) in your OS image. If you want to run DevHealth from Platform Builder by using a kernel independent transport layer (KITL) connection, copy Devhealth.exe and Devhealthdll.dll to the flat release directory.

Run DevHealth

You can run DevHealth with command-line options to produce different memory usage reports. When you run DevHealth with no command-line options, the output is the same as when you use the option all. The command-line options are listed in the following table.

Command-line option

Result

Report description (if applicable)

all

Produces all of the reports listed in this table. The output is the same as if there were no command-line options.

Each report is described in this table.

system

Produces a system memory report

This report lists the amount of RAM and non-volatile storage that is on the device and provides an overview of the number of pages that are used by each consumer of RAM.

map

Produces a system memory map report

This report shows the individual page types of the virtual memory that is used by each process.

proc

Produces a process report

For each process, this report lists the number of pages of virtual memory that are used for a subset of page types.

mod

Produces a module report

For each DLL module, this report lists the number of pages of virtual memory that are used for a subset of page types.

heap

Produces a heap report

For each heap that is used by each process, this report lists the starting and ending address and the number of blocks that are allocated for each module.

depend

Produces a dependency report

This report lists the module reference counts for all processes and DLL modules that are loaded into memory.

ignoredup

Ignores duplicate pages

None.

pte

Displays page table entries

None.

timer

Generates a report every 15 minutes

None.

Interpret the Report Data

DevHealth reports are text files that you can view by using any text file viewer. Every time you run DevHealth, it creates an output text file named mem_*.txt, where the wildcard is a number based on how many mem_*.txt files already exist in the directory.

Note

Every time you run DevHealth, it creates just one output file (mem_*.txt), which contains all of the individual reports that you chose to run based on your command-line options.

DevHealth puts its output file in one of the following locations on the device, whichever one it finds first:

  1. \Storage Card

  2. \Hard Disk

  3. \Release

    Warning

    If you run DevHealth while connected to Platform Builder over a KITL transport, you can access your device’s \Release directory on your development computer by going to the flat release directory, which is the same as the \Release directory on your device. The flat release directory is a single directory on your development computer that contains all of the files to be included in the final OS image, specified as the Release directory in the <My Project> Property Pages dialog box in Platform Builder.

  4. Device root directory

In This Section

  • Dependency Report
    Cross-references the reference counts between running processes and loaded DLL modules.
  • Heap Report
    Provides the starte and end address of the heap region, the number of allocation blocks, and the total size of the allocation.
  • Module Report
    Displays the number of pages for three page types for all DLL modules that are loaded in memory at the moment that DevHealth runs.
  • Process Report
    Displays the number of pages of certain page types that each process uses at the moment that DevHealth runs.
  • System Memory Report
    Provides a summary of the amount of RAM and non-volatile storage on the device and shows which consumers are using the physical RAM at the time that you run the DevHealth tool.
  • System Memory Map Report
    Provides detailed information about the virtual memory usage of the device at the moment that you run DevHealth.

See Also

Concepts

Tools