Share via


Remote Resource Consumer (Compact 2013)

3/26/2014

You can use the Resource Consumer remote tool to adjust the available CPU, memory, storage, and process resources that are available on the device to see the resulting effect on device performance.

How to Use

To start the Resource Consumer in Platform Builder

  • In Platform Builder, on the Tools menu, click Remote Tools, and then click Resource Consumer.

    The Resource Consumer starts. You are now ready to change the amount of resources that are consumed on the device.

To start the Resource Consumer in the Remote Tools Shell

  1. In the Remote Tools Shell, on the View menu, click Remote Tools Shell Plug-in Explorer.

  2. In the Plug-in Explorer navigation pane, browse to the device on which you want to run the Resource Consumer, and then expand the node.

  3. (Optional) If you do not see the Resource Consumer listed under the node associated with your device, select Show all plug-ins for all devices.

  4. To start the Resource Consumer, double-click Resource Consumer.

    The Resource Consumer starts. You are now ready to change the amount of resources that are consumed on the device.

To start the device-side executable ResourceConsumer.exe from Platform Builder

  1. Make sure that you have started the desktop-side Resource Consumer remote tool at least one time previously, and that you are currently connected to the target device that you want to test.

  2. In Platform Builder, on the Target menu, click Alternate Release Directories.

  3. In the Alternate Release Directories dialog box, click Add New Directory, enter the following path, and then click OK.

    C:\Program Files (x86)\Microsoft Remote Framework Tools\8.00\target\wce800\<cpu>

    You only have to do this one time for each run-time image that you have downloaded to a device in Platform Builder.

  4. To register the new path and close the dialog box, click Apply.

  5. In Platform Builder, on the Target menu, click Target Control, and then enter the ResourceConsumer.exe syntax that you want to use.

    For more information about the available options, enter the following command.

    s resourceconsumer /?
    

To consume processes on a device

  1. In the right pane of the Remote Tools Shell, in the Process group, in the In Use By Consumer field, enter the number of processes that you want to start on the device.

  2. Click Apply.

To consume program and storage memory on a target device

  1. In the right pane of the Remote Tools Shell, in the Memory group, follow these steps:

    1. To modify the storage memory that is available, in the In Use By Consumer field that corresponds to the Storage Memory (bytes) column, enter a value in bytes for the memory that you want to consume.
    2. To modify the program memory that is available, in the In Use By Consumer field that corresponds to the Program Memory (bytes) column, enter a value in bytes for the memory that you want to consume.
  2. Click Apply.

    The effects of any changes that you have made might take several moments to be visible.

    Note

    On some Windows Embedded Compact-based devices, setting program memory consumption to the out of memory low level, which is device-specific, causes the device to dynamically allocate more storage memory to program memory.

To adjust CPU load on a target device

  1. In the right pane of the Remote Tools Shell, in the CPU group, follow these steps:

    1. In the CPU field, select the ID of the CPU on which you want to run the CPU consumer thread.
    2. To modify the percentage of the time that you want the thread to be active, adjust the Consumer Thread Spinning% slider, or enter a numeric value in the associated box.
      (Optional) If you want to turn off the thread, set this value to 0%.
    3. To modify the priority of the thread, adjust the Consumer Thread Priority option, or enter a numeric value in the associated box.
      The typical priority value for this thread is 251.
  2. Click Apply.

Remarks

Note

You cannot run the Resource Consumer remote tool and the device-side executable ResourceConsumer.exe on a single device at the same time.

You can perform any of the following tasks:

  • Adjust the CPU load by modifying the number of CPUs, the thread spinning percentage, and thread priority.
  • Consume program and storage memory by modifying the in-use values.
  • Consume processes by modifying the number of running processes.

You can use the Resource Consumer remote tool to consume processes on the device. This helps you simulate specific conditions, such as a condition where the OS cannot allocate a sufficient number of handles, under which you can test an application. On the device, each process consumes at least two handles: one for the process, and one for the main thread of the process.

To consume processes, the Resource Consumer runs a simple process named ProcessConsumer.exe, approximately 7 KB. This process goes to sleep until it is ended, so it does not consume significant CPU cycles.

This procedure assumes that the Resource Consumer is connected to a running device.

You can use the Resource Consumer remote tool to limit the available program and virtual memory on a device by adjusting how much is consumed. This helps you simulate specific conditions, such as low memory conditions, under which you can test an application.

To consume storage memory, the Resource Consumer opens a file on the device and adjusts the amount of data in the file.

To consume program memory, the Resource Consumer uses a call to VirtualAlloc to allocate a memory buffer of the specified size on the heap.

You can use the Resource Consumer remote tool to adjust the CPU load by modifying the characteristics of a CPU consumer thread on a device. This helps you simulate specific conditions, such as a busy CPU, under which you can test an application.

To adjust CPU load, the Resource Consumer modifies the portion of the thread quantum (1000 milliseconds) that is assigned to non-critical tasks such as continuously incrementing a variable.

This procedure assumes that in the Remote Tools Shell, the Resource Consumer is open and is connected to a running device.

See Also

Other Resources

Remote Tools