cbNKPagingPoolSize (Windows CE 5.0)

Send Feedback

This variable enables OEMs to limit memory used for paging read-only code/mapfile by setting the variable to the maximum memory allowed.

DWORD cbNKPagingPoolSize;

Parameters

None.

Return Values

None.

Remarks

The paging pool is a reserved block of RAM that is used for holding pages of code that need to be executed. If the paging pool is not enabled, the entire RAM on the device is available for paging, which can drastically increase RAM usage. Enabling the paging pool basically sets aside a limited amount of RAM for paging. The higher the paging pool size, the more RAM is available for paging. This results in fewer pagefaults since more code can be held in the paging pool. It is important to determine the right balance between RAM usage for paging pool and paging performance for each platform. The optimum paging pool size depends on a lot of factors. The following list shows examples of some factors that affect the optimum paging pool size:

  • Attributes of OEM components, such as device drivers. Examples of attributes are total size and pageability.
  • Total available RAM
  • Processor speed
  • Flash technology, e.g. NAND or NOR

To determine the optimum paging pool size, you should collect performance data for various paging pool sizes.

The following table shows an example of data that was collected for a reference Windows Mobile-based Smartphone platform:

Paging pool size (MB) 3.0 3.5 4 .0 4.5 5.0 6.0
Boot time (sec) 38.1 37.4 34.6 31.2 29.7 28.4
Inbox launch (sec) 3.31 3.20 2.77 2.66 2.59 2.45
Contacts launch (sec) 1.72 1.62 1.41 1.20 1.16 1.15

You can graph the performance versus paging pool size for each performance scenario to determine the sweet spot that provides a good balance between RAM used for paging pool and performance. For the above table, 4.5 MB is the sweet spot.

Setting the paging pool size

You can set the paging pool size by setting the PAGINGPOOLSIZE environment variable in the build window, followed by makeimg. The following steps show how to set the paging pool size to 4.5 MB:

set IMGPAGINGPOOL=1
set PAGINGPOOLSIZE=00480000
makeimg

Collecting performance data

The boot time and application launch time are affected by the paging pool size. Therefore, they provide good data for determining the optimum paging pool size. It is important to measure the boot time and application launch time consistently 3-5 times, and then use the data average.

Boot time

Start the stopwatch as soon as you press the power button (method 1) or when you see the boot loader screen (method 2). Make sure to be consistent, since there is a few seconds difference between the two methods. Stop the time when the home screen soft keys are drawn.

Do not measure the first couple of boots after clearing flash because the software performs extra initialization during those boots. Subsequent boot times should be consistent and will provide good data points.

Application launch time

Start the stopwatch as soon as you perform the appropriate user input to launch the application. Stop the time as soon as the soft keys are drawn for the application. Inbox, Contacts, and Calendar are good candidates for these measurements. It is important to measure the first launch after boot. It is even more important to launch the applications in the same order at every boot.

Taking advantage of NOR

If you have NOR flash available, you should consider uncompressing as many packages as possible onto the NOR flash. It helps both execution performance and RAM usage because the code can be executed in place and it avoids paging hit and the RAM need for paging.

Writeback cache

Writing to flash is a bottleneck for a lot of scenarios on the device. To mitigate the bottleneck, you can enable the writeback cache for the flash file system on the platform. A 64KB of cache is considered enough for the key user scenarios.When registering the flash file system in platform.reg, the following registry keys in bold set up the flash file system for a 64KB writeback cache. The MSFlash should be replaced with the name of the profile for the block driver that controls the TFAT partition.

[HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\MSFlash\FATFS]
    "Flags"=dword:00000014
    "FormatTFAT"=dword:1
    "MountAsBootable"=dword:1
    "MountAsRoot"=dword:1
    "CheckForFormat"=dword:1
    "EnableWriteBack"=dword:1
    "DataCacheSize"=dword:00000080      ;128 sectors(128*512=64KB)

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Developer-defined.

See Also

Kernel Global Variables

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.