Microsoft KB Archive/815227

= Performance degradation occurs in the UnmapViewOfFile function =

Article ID: 815227

Article Last Modified on 8/29/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional

-



SYMPTOMS
A program that uses mapped file views that are larger than 500 megabytes (MB) may experience a significant performance decrease. Mapped file views are frequently used to share information between two or more processes. The performance degradation occurs in the UnmapViewOfFile function.



CAUSE
This problem occurs if a program maps file views that are larger than 500 MB in Microsoft Windows Server 2003 or in Microsoft Windows XP Service Pack 1 (SP1).



Service pack information
To resolve this problem, obtain the latest service pack for Windows XP. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to obtain the latest Windows XP service pack

Hotfix information
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time      Version        Size       File name     Platform ---   28-Feb-2003  16:17    5.1.2600.1178   1,895,424  Ntkrnlmp.exe  i386 28-Feb-2003 16:17    5.1.2600.1178   1,951,232  Ntkrnlpa.exe  i386 28-Feb-2003 16:17    5.1.2600.1178   1,923,584  Ntkrpamp.exe  i386 28-Feb-2003 16:17    5.1.2600.1178   1,927,424  Ntoskrnl.exe  i386 28-Feb-2003 16:17    5.1.2600.1178   5,826,432  Ntkrnlmp.exe  ia-64 28-Feb-2003 16:17    5.1.2600.1178   5,736,704  Ntoskrnl.exe  ia-64

Windows Server 2003
Although the problem manifests with a call to the UnmapViewOfFile function, the required code change is deep within the kernel. Because of the risk of changing core memory management functions, a hotfix for Windows Server 2003 will not be available. The code fix for Windows Server 2003 will be available in Windows Server 2003 Service Pack 1.

Programs that could be affected by this problem can be identified by using Performance Monitor. To do this, follow these steps:  Create a performance monitor log by following the steps that are described in Microsoft Knowledge Base article 248345 or by using the Performance Monitor Wizard.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

248345 How to create a log using System Monitor in Windows

 Log server activity during busy times. Stop the performance monitor log and review Working Set Size Peak under the Process performance object. Find any process where the working set size has exceeded 500 MB. Subtract the working set size value of each process that you identified in step 3 from the corresponding Private Bytes entry under the Process performance object.

If the working set for a process is 500 MB more than the private bytes, the program could be using large mapped views of files and could be affected by the performance degradation from calling the UnmapViewOfFile function. If these programs are randomly not responding or are unresponsive for long periods of time, debugging analysis or code review may be needed to verify that the programs are affected by this issue.

If the program is affected by this performance issue, the following coding workarounds are available for Windows Server 2003 until Windows Server 2003 Service Pack 1 is available:
 * 1) Remove calls to the UnmapViewOfFile function in programs that run in Windows Server 2003. This function call is necessary only if the process must map multiple sections of memory to the same memory address. The operating system will clean up the shared sections as soon as the last thread has exited.
 * 2) If you must call the UnmapViewViewOfFile function, write a new program to create a job object (CreateJobObject). Use the SetInformationJobObject function to set the maximum working set size to approximately 500 MB by setting the MaximumWorkingSetSize property in the _JOBOBJECT_BASIC_LIMIT_INFORMATION parameter. (This setting is 24 MB with the /3GB switch.) Associate all the required processes with this job object.

This program should be run after the required processes have already started. If one of those processes restarts, this program must be rerun. You may not incur a huge performance penalty if you limit the working set size for the process. If there is lots of available RAM on the system, the pages that are removed from the process's working set will be put on the standby list. If a page fault is incurred, it will probably be serviced by the page on the standby list in physical memory. Performance benchmarks should be run to determine the actual performance effect for this workaround.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Microsoft Windows XP Service Pack 2. The problem is scheduled to be fixed in Windows Server 2003 Service Pack 1.

Additional query words: P4, pentium 4, pentium IV, multiproc, dualproc, hyperthreading, kernel, slow performance, office, word, MapViewOfFile, 100% CPU, high CPU usage, delays of 4 seconds

Keywords: kbhotfixserver kbqfe kbwinxpsp2fix kbtshoot kbenv kbqfe kbwinxppresp2fix kbfix kbbug KB815227

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.