The Microsoft Access ODBC driver uses the MaxBufferSize setting for Jet to
determine its maximum buffer size.
The Jet MaxBufferSize is a registry entry in the following path:
HKEY_LOCAL_LACHINE\Jet\3.5\Engines\Jet 3.5
It is normally set to zero (0). The setting of zero indicates that Jet uses
a default algorithm to determine the maximum cache size. That algorithm is
"(((Total RAM on computer in MB - 12MB) / 4) + 512K)". This returns a value
equal to the number of pages that the cache size can increase. Each page is
2048 bytes, so for a computer with at least 64 MB of RAM, this algorithm
returns approximately 14 MB. This is the maximum memory that Jet consumes
from its startup point.
Following is an example of the calculation for a 64 MB computer:
(64Mb - 12Mb) / 4 + 512K
= 52Mb/4 + 512K
= 13Mb + 512K
= 13.5Mb
Jet will not allow the "Total RAM on computer" calculated earlier to exceed
64 MB. If the total RAM on the computer is 12 MB or less, then the
algorithm creates a 512 KB cache buffer.
Jet will use memory for its cache until it reaches this dynamic setting if
the MaxBufferSize registry setting is zero (0). If the MaxBufferSize
registry setting is set at 512 KB, for example, the cache size will be
limited to 512 KB. Once Jet exceeds the setting, it fires off a background
thread to reduce the memory to the point that it goes below the maximum
cache size setting.
You can typically minimize the growth of the Jet cache by dropping a
HSTMT() statement handle and creating a new one. In this case, the memory
at the beginning of the Jet cache will be re-used.