Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: NOT_ENOUGH_STORAGE Errors in IIS Log File


View products that this article applies to.

This article was previously published under Q193026

↑ Back to the top


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

↑ Back to the top


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. .........................................
  2. 7777777.................................. Large block reserved.
  3. 77777771................................. Small block allocated.
  4. .......1................................. Large block released.
  5. 1......1................................. Small block allocated.
  6. 1......17777777.......................... Large block reserved.
  7. 1......177777771......................... Small block allocated.
  8. 1......1.......1......................... Large block released.
  9. 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.

↑ Back to the top


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: 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

  1. 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.
  2. Stop the IIS Admin service and any other applications that use MDAC.
  3. Copy over the existing OLE DB files. For example:

    xcopy c:\mdacfix "C:\Program Files\Common Files\System\OLE DB"
  4. 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.
  5. Shut down and restart.

↑ Back to the top


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.

↑ Back to the top


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:

   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.

↑ Back to the top


Keywords: kbhotfixserver, kbqfe, kbbug, kbdatabase, kbfix, kbqfe, KB193026

↑ Back to the top

Article Info
Article ID : 193026
Revision : 6
Created on : 9/22/2005
Published on : 9/22/2005
Exists online : False
Views : 587