Paging pool in WinCE

Source: Internet
Author: User

We know that in config. bib configuration, the memory area specified by Ram is divided into program memory and Object Storage. However, when using the paging pool, the RAM segment must be equal to the size of the paging pool, and the remaining space is divided into program memory and Object Storage. The program memory mainly stores heap and stack content for running programs.

So what is the paging pool? What are the advantages of using the paging pool? After reading the relevant materials, I want to criticize and correct my knowledge. (For more information about paging and the Windows CE paging pool, see Sue LOH .)

Let's take a look at the concept of paging pool. The paging pool is a region of the reserved in Ram. Used to store pageale data (read-only executable file code, data, and memory ing files ). If paging pool is used, the memory used by pageale data is limited. It also includes the algorithm mechanism for removing pagable data from memory.

In systems earlier than wince3.0, paging pool is not used. This means that the system has no restrictions on the RAM used to save pageable data. If you run a large number of programs or access a large number of memory ing files, the memory usage will greatly increase until the system runs out of memory, and the memory allocation will fail. It seems that the memory is actually used up, but there is still a lot of space that can be released through page data out. Finally, when the system reaches a minimum memory limit, the kernel will page out all the pageble data. In this way, the system will suddenly have a lot of available memory, and the data you want to use will be re-directed to the memory by generating the page fault. However, this will cause system instability.

Therefore, WinCE introduces the paging pool. The paging pool limits an amount of pageable memory system can has so it wocould be less "thrashing" Prone. Using the paging pool, a limited amount of Ram will be set to store pageable data. The size setting of the pool is too small, which means pages may be too early to page out, even though they are still in use, resulting in frequent page fault. The pool size is too large, which means the operating system will retain more memory for pageable data. This reduces page faults because more code is stored in the paging pool. However, the pool memory cannot be used by applications.

In Ce 6.0, the virtual memory architecture has changed, involving rewriting of the Windows CE storage system, including the paging pool. The principle of the paging pool of Ce 6.0 is still quite simple, but it is a little more flexible. Ce 6.0 has two paging pools: The loader pool is used to store executable code. The file pool is used to store all file-backed memory-mapped files and the File Cache filter added by ce6.0, or the cache manager. In this way, OEMs can not only set the memory usage of read-only data, but also set the memory usage of read-write data. You can set the memory usage limits for the code and data respectively.

The two pools have several parameters. The main parameters are target size and maximum size. The operating system always ensures that the pool has at least the target memory. If there is excess available memory, the kernel allows the pool to occupy more memory than the target. However, when this happens, the kernel will wake up a low-priority thread to page out some data, and then slowly drop the pool below the target. In this way, when the busy "Spikes" memory is used, for example, when the system is started, the system will occupy a considerable amount of memory to store pagable data. However, in steady-state, the system's pool memory usage lingers up and down on the target. Maximum Size sets a hard limit for memory consumption. OEMs can set this maximum to a large extent to avoid pool restrictions. OEMs can also set the size of target and maximum to get the effect of paging pool in versions earlier than ce6.

The paging and paging pools are independent. Paging occurs no matter whether it is a paging pool or not. If you disable the paging pool, you disable the ram restrictions for paging. However, pages can still be paging. If you open the paging pool, there are limits. For paging pool, the data of page in can also be page out. Data in a non-Paging pool is not page-out.

The code and read-only data of executable files in ROM will use the pool. The R/W data in the executable file cannot be page out, So paging pool is not used. The code and read-only data in the compressed executable files in modules also use the pool. If the image is run from the nor or RAM, unzipped executable files in the modules will run directly without using the pool. The executable files in the modules in the image in NAND will use the pool.

If the executable file is marked as "non-pagable", the file will be loaded into RAM and will not be page out until it is uninstalled. These pages do not use a pool. You can also create executable "partially pagable" by telling linker to make some sections non-pagable. Generally, code and data cannot be pagable if they are part of ISR, called at suspend/resume, or called by other power sources, because paging may cause system crashes or deadlocks. If code and data are accessed by ist, it cannot be pagable, because paging affects real-time performance.

The memory ing file of Ram-backed does not use the pool. In ce5 or earlier versions, read-only file-back mapfiles use the pool instead of R/W mapfiles. In ce6, all file-backed mapfiles use the File pool. In addition, the new File Cache filter (cache manager) maps all open files, so the cached file data also uses the pool.

In ce5.0, if you want to use the paging pool, you only need to define the following in config. bib:

# Define pagingpoolsize 00500000

Cbnkpagingpoolsize 00000000 $ (pagingpoolsize) fixupvar

Set the size of the paging pool to 5 MB. If it is set to 0 or not, the paging pool is not enabled, and there is no Ram limit for storing pageable data and code, the effect is the same as that of wince3.0 when there is no paging pool. However, we recommend that you use the paging pool. It is difficult to set the pool size. It is not suitable if it is too large or too small. However, in CE 6.0, if the size is set to 0, the system will automatically adjust the cbnkpagingpoolsize, which is more convenient.

 

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/flyalice/archive/2009/02/16/3897253.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.