Article ID: 248014 - Last Review: July 28, 2003 - Revision: 1.1 PRB: Jet OLE DB Provider Consuming Too Much Memory
This article was previously published under Q248014 SYMPTOMS
After performing a large number of operations ( for example, inserts) on a Microsoft Jet database engine with the Jet 4.0 OLE DB Provider, large amounts of memory are consumed by the application. For example, performing 1000 inserts in a tight loop may reveal 100+ megabyte usage. When the connection is closed, the memory is freed.
CAUSE
The Jet 4.0 OLE DB Provider sets the Jet OLEDB:Max Buffer Size property to 0 by default. This allows the size of the cache to grow very large. For example, on a 256-MB computer up to 132 megabytes can be consumed by Jet. If you are using Visual C++, the Max Buffer Size property is a session property (DBPROPSET_JETOLEDB_SESSION property set) with the value of DBPROP_JETOLEDB_MAXBUFFERSIZE. These constants are defined in the Msjetoledb.h file that is included with the Microsoft Data Access SDK. IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base: 256986
(http://support.microsoft.com/kb/256986/EN-US/
)
Description of the Microsoft Windows Registry
The Max Buffer Size property control is the maximum amount of memory that can be used by the read-ahead/write-ahead Jet cache. Note that the Max Buffer Size property doesn't have any affect on Jet 3.x files. You must set the registry to the following registry setting:
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Jet 3.x\MaxBufferSize RESOLUTION
Set the Jet OLE DB:Max Buffer Size property to a value such as 2048 kilobytes. When using ADO, the property must be set after opening the connection. When using the Visual C++ ATL consumer templates, you must set the property using the session object. Here is an code sample of how to use the property in a Visual Basic application: Following is Visual C++ ATL code which demonstrates how to set the property: STATUS
This behavior is by design.
REFERENCES
The Microsoft Developer Network CD contains more information about Jet OLE DB Provider specific properties. Search on the DBPROPSET_JETOLEDB_SESSION property. This search places you into the Jet OLE DB Provider documentation where you can find out more about the provider specific properties.
| Other Resources Other Support Sites
CommunityArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

Back to the top