Microsoft KB Archive/193026

= FIX: NOT_ENOUGH_STORAGE Errors in IIS Log File =

Article ID: 193026

Article Last Modified on 9/22/2005

-

APPLIES TO


 * Microsoft Data Access Components 1.5
 * Microsoft Data Access Components 2.0
 * Microsoft Data Access Components 2.1 Service Pack 2
 * Microsoft Internet Information Server 4.0

-



This article was previously published under Q193026



SYMPTOMS
When you open a rowset, the OLE DB Provider for ODBC tries to reserve a block of memory that can be 64K times greater than the size of a single row. Under some circumstances, the reservation can be far larger (7MG+) but for the purpose of discussion in this article, assume 64K is the average. If the OLE DB Provider cannot reserve this block of memory, the OLE DB Consumer application will receive E_OUTOFMEMORY error.

This error message can occur even when there is plenty of memory left on the system, and, depending on the environment, the error message might not be E_OUTOFMEMORY. Internet Server sites that use ADO (ActiveX Data Objects) heavily with the OLE DB Provider for ODBC might receive the following error message in the IIS Log file:

Not_enough_storage_is_available_to_complete_this_operation



CAUSE
The E_OUTOFMEMORY error message is caused by the failure of the virtual allocation to reserve a block of memory 64K times the size of a single row in the rowset (ADO Recordset) that is being opened by the provider. The address space reservation fails due to memory fragmentation in the applications process address space, not due to an actual shortage of memory.

NOTE: Memory managers normally include algorithms that address memory fragmentation. However, since Microsoft Data Access Components (MDAC) uses virtual memory directly (for performance gains) it bypasses the algorithms in the heap memory manager, thus allowing fragmentation to occur.

For example, for Internet Information Server applications this would be the Internet Service Process (InetInfo.exe). Memory fragmentation occurs in the Inetinfo.exe process address space when MDAC reserves and then releases memory blocks on each page. If the row size is 200 bytes, then MDAC will reserve a memory block 12.8 Meg in size. When combined with smaller memory allocations that fill the large memory "holes" vacated by the multiple-megabyte allocations. Further, smaller allocations on the same page as the large allocation mean the page will not be released until all allocations, large and small, have been released.

A diagram of how the memory fragmentation occurs follows:


 * 1) 7777777.................................. Large block reserved.
 * 2) 77777771................................. Small block allocated.
 * 3) .......1................................. Large block released.
 * 4) 1......1................................. Small block allocated.
 * 5) 1......17777777.......................... Large block reserved.
 * 6) 1......177777771......................... Small block allocated.
 * 7) 1......1.......1......................... Large block released.
 * 8) 1......1.......1......................... Small block allocated.
 * 1) 1......1.......1......................... Small block allocated.

After numerous iterations of small and large allocations, the example process address space becomes so fragmented that the large allocation no longer fits in memory, resulting in the E_OUTOFMEMORY error.



RESOLUTION
A supported fix that corrects this problem is now available from Microsoft with Windows NT 4.0 Service Pack 4 for MDAC 2.0. MDAC 2.0 Service Pack 1 only ships in the context of Windows NT 4.0 Service Pack 4 (and should not be used on Windows 95 or Windows 98 or Windows NT 4.0 Service Pack 3). For users who are not installing Windows NT 4.0 Service Pack 4, a hotfix is available for both MDAC 1.5 and 2.0.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

The English version of the MDAC 1.5c fix should have the following file attributes or later:

  Version         Size     Date       File name      Platform ---

1.50.4515.0       113   09-08-98   Maxblock.reg  (x86) 1.50.4515.0    47,600   09-15-98   Msdadc.dll 1.50.4515.0    16,752   09-15-98   Msdaenum.dll 1.50.4515.0    29,920   09-15-98   Msdaer.dll 1.50.4515.0    13,072   09-15-98   Msdaerr.dll 1.50.4515.0    14,336   09-15-98   Msdaps.dll 1.50.4515.0   263,056   09-15-98   Msdasql.dll 1.50.4515.0    17,408   09-15-98   Msdasqlr.dll 1.50.4515.0    60,048   09-15-98   Msdatl.dll 1.50.4515.0    39,120   09-15-98   Msdatt.dll

The English version of the MDAC 2.0 fix should have the following file attributes or later:   Version        Size      Date       File name      Platform ---

2.0.3002.23       113   09-08-98   Maxblock.reg   (x86) 2.0.3002.23   287,184   09-10-98   Msdasql.dll 2.0.3002.23     9,728   09-10-98   Msdasqlr.dll 2.0.3002.23    67,152   09-10-98   Msdatl2.dll 4.0.1381.0     30,720   03-13-98   Regsvr32.exe

Installation Instructions
 For MDAC 1.5c, extract the MDAC 1.5c files from Oledb15c.exe to C:\Mdacfix.

For MDAC 2.0, obtain MDAC 2.0 Service Pack 1 (preferred) and run MDAC_TYP.exe to install the service pack. Stop the IIS Admin service and any other applications that use MDAC. Copy over the existing OLE DB files. For example:

xcopy c:\mdacfix "C:\Program Files\Common Files\System\OLE DB"

 For MDAC 1.5c, double-click C:\MDACFix\MAXBlock.reg to enter the necessary registry changes.

For MDAC 2.0, double-click C:\MDACFix\MAXBlock.reg to enter the necessary registry changes. Shut down and restart.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in Data Access Components versions 1.5c and 2.0. This problem has been fixed in MDAC 2.02, which ships with Windows NT 4.0 Service Pack 4. However, please note that the MAXBlock.reg should still be applied irrespective of the MDAC version.

<div class="moreinformation_section">

MORE INFORMATION
The fix resolves the address space problem by reducing the default virtual address allocations to 16 KB. Large queries still complete because the updated MDAC components reallocate virtual address space if you need more than 16 KB.

NOTE: You can further tune the default allocation size of 16 KB by adjusting the new registry value:

<pre class="fixed_text">  HKEY_CLASSES_ROOT\CLSID\{c8b522cb-5cf3-11ce-ade5- 00aa0044773d}\Flags\"MaxBlock" You can reduce the default allocation further to 100, but no lower than this value.

Keywords: kbbug kbfix kbqfe kbdatabase kbhotfixserver KB193026

-

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

© Microsoft Corporation. All rights reserved.