Microsoft KB Archive/897337

= Memory usage is larger when you use a custom implementation of the ILockBytes interface to perform file operations in Windows 2000 =

Article ID: 897337

Article Last Modified on 12/25/2006

-

APPLIES TO


 * Microsoft Windows 2000 Service Pack 4
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Advanced Server

-





SYMPTOMS
Consider the following scenario. You open files to perform file operations, and you use a custom implementation of the ILockBytes interface in Microsoft Windows 2000 Server. You may find that memory usage is larger for files that are opened in read-only mode than for the files that are opened in read-and-write mode. Additionally, you may be able to open more files in read-and-write mode than in read-only mode.

For example, you may find that 3,000 files can be opened in read-and-write mode before the system reaches the 2 GB virtual memory limit. However, only 1,200 files can be opened in read-only mode before the 2 GB virtual memory limit is reached.

Note If the STGM_NOSNAPSHOT flag is used in read-only mode, memory usage may be the same for both read-only and read-and-write mode operations.



CAUSE
This problem occurs because a temporary scratch file is created to save the modifications that are made to the file. This temporary file is mapped to memory until the changes are saved in the original file. The custom ILockBytes interface turns off memory mapping of the original and the snapshot file, but the scratch file is always mapped unless the memory limits are reached.



Hotfix information
A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;[LN;CNTACTMS]

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites
Because of file dependencies, this hotfix requires Microsoft Windows 2000 Service Pack 4.

Restart requirement
You do not have to restart your computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
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 item in Control Panel.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
For more information about the ILockBytes interface, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa379238.aspx

For more information about the STGM flags, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa380337.aspx

Keywords: kbhotfixserver kbbug kbfix kbqfe kbwin2000presp5fix kbpubtypekc KB897337

-

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

© Microsoft Corporation. All rights reserved.