Microsoft KB Archive/322816

= Commerce Profile Services returns E_OutofMemory =

Article ID: 322816

Article Last Modified on 9/22/2004

-

APPLIES TO


 * Microsoft Commerce Server 2002 Standard Edition
 * Microsoft Commerce Server 2000 Standard Edition
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q322816



SYMPTOMS
The Commerce Server OLE DB provider may return the following error messages indicating that memory resources are used up. These events may also be associated with memory fragmentation:

Event Type: Error

Event Source: Commerce Server 2000

Event Category: None

Event ID: 32785

Date: 6/30/2001

Time: 4:14:32 AM

User: N/A

Computer: ServerName

Description:

Could not create the catalog (-2147024882)

Event Type: Error

Event Source: Commerce Server 2000

Event Category: None

Event ID: 32773

Date: 6/30/2001

Time: 4:14:32 AM

User: N/A

Computer: ServerName

Description:

DataSource::Init(DS-10715[Class Factory]DS-10716-Profile Definitions)

failed on catalog load (-2147024882)

Event Type: Error

Event Source: Commerce Server 2000

Event Category: None

Event ID: 32769

Date: 6/30/2001

Time: 4:14:32 AM

User: N/A

Computer: ServerName

Description:

In BindArgs::OpenDataSrc, failed initializing data source (-2147024882)

Event Type: Error

Event Source: Commerce Server 2000

Event Category: None

Event ID: 32794

Date: 6/30/2001

Time: 4:14:32 AM

User: N/A

Computer: ServerName

Description:

Could not bind to connection string (-2147024882)

NOTE: -2147024882 (8007000e) is defined as E_OUTOFMEMORY. The following is the detailed HR error result for this:

Error Result : 0x8007000E ( -2147024882 )

ID Defined as : E_OUTOFMEMORY

Error Type : OLE HRESULT Error

Facility : FACILITY_WIN32 0x00000007 ( 7 )

Severity : SEVERITY_ERROR 0x00000001 ( 1 )

Code : 0x0000000E ( 14 )

Source Error file : Winerror.h

Message Text : Not enough storage is available to complete this operation.



CAUSE
The system may be configured with a large quantity of physical memory. Tools such as Task Manager and Performance Monitor may indicate that a large portion of that memory is available. For example, if the system is configured with four gigabytes of physical memory, less than one gigabyte of this memory may be in use. However, if the virtual memory for the Internet Information Services (IIS) DLLHost process for Medium Isolation mode approaches two gigabytes, problems start to occur. Even if the server has large memory resources that are available to the system, the virtual memory of the IIS process may become fragmented. Various errors may be reported, indicating that memory resources have been used up.

The Commerce Server OLE DB provider typically uses the SQL OLE DB provider to perform database operations. In a large E-Commerce site, the Commerce Profile services must continually retrieve data from the SQL database. The SQL OLE DB provider tries to allocate large contiguous blocks on demand to perform these operations. These allocations are performed in the virtual memory address space of the IIS process. If this process is approaching the process limit for virtual memory that is established by Microsoft Windows 2000, errors result. If no blocks of contiguous virtual memory are available because of fragmentation, the application may return error messages indicating that no memory is available.



RESOLUTION
To alleviate these symptoms, the system must be configured to prevent each IIS process from using up the virtual memory that is available. By default, Windows 2000 with IIS 5.0 is configured in Medium Isolation mode. In this configuration, the Commerce 2000 and Web site code use a shared DLLHost process. Use Performance Monitor to make sure that the virtual memory for this process does not approach two gigabytes. For additional information about optimizing IIS and using Performance Monitor, click the following article number to view the article in the Microsoft Knowledge Base:

305313 Optimizing Internet Information Services 5.0



MORE INFORMATION
You can use several methods to prevent the DLLHost process from exceeding the two-gigabyte limit for virtual memory. To determine whether virtual memory is being exhausted, use Performance Monitor (PerfMon) to log process information. Gather the virtual byte data, and then determine whether it is approaching the two-gigabyte process limit.

For many reasons, the DLLHost process virtual bytes may increase over time to a significant size. You can monitor ASP cache parameters to determine how long it takes to populate the cache. ASP caching and other code execution may cause significant virtual byte use. You can perform virtual allocations by running code (such as custom ASP and COM object code) with the DLLHost process. The Commerce Profile Services must use the Commerce Server OLE DB provider to perform SQL OLE DB operations to provide database connectivity. This requires blocks of virtual memory to be allocated on demand to complete the operations. You can configure several options to limit virtual memory use.

If the commerce LRUCache object is in use, monitor the DLLHost process that represents the Commerce Web site. Monitor the process private and virtual byte utilization. If these properties grow in direct correlation to the LRU cache growth over several days, this can be a symptom of a problem. It may contribute to resource exhaustion. In this case, you must reduce the size of any LRUCache object that is configured.

LRUCache objects can contain entries that are made up of a variety of objects. If those objects are large, you must restrict the number of entries for the cache. Obtain PerfMon Log Data for the following:
 * Process
 * DllHost
 * Virtual Bytes
 * CS2000: Marketing and Catalog
 * LRUCache: Cache Size

LRUCache Tuning
You must tune each LRUCache object individually. If multiple LRUCache objects are configured, set the size to 0 for all except one of these objects. Then perform operations against the server. Use PerfMon to monitor the LRUCache: Cache Size growth and the DLLHost virtual and private byte utilization. The utilization must be within system limits. Also, the cache should be fully populated in a reasonably short period. When the cache is populated, resource utilization growth will decrease and the Cache Size will approach its maximum configured size.

For more information about LRUCache implementation, visit the following Microsoft Web site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csvr2002/htm/cs_rp_lrucache_zqnv_c.asp

Options for Reducing IIS Process (DLLHost) Virtual Memory Resources
Note The following recommendations are examples that you can use to minimize memory use. Verify optimal cache settings and requirements by carefully monitoring a particular system implementation.  Reduce the ASP cache configuration:  Click Start, point to Programs, click Administrative Tools, and then click Internet Services Manager. Right-click your server, and then click Properties. In the WWW Service Master Properties dialog box, click Edit. Click the Home Directory tab. Click Configuration under Application Settings.</li> Click the Process Options tab.</li> Change Number of script engines cached from 125 (the default) to 50 .</li> Change Max ASP files cached from 250 (the default) to 100 .</li></ol> </li> Determine whether you can configure more Web site virtual directories or COM+ packages to run in isolated out-of-process packages.</li> Set the  registry parameter to a value of 4000 (hexadecimal). For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

235461 Enhancing performance in Internet Information Server 4.0

</li></ul>

<div class="references_section">