'Insufficient memory for this operation error - Delphi 5 and BDE
I have an application developed in Delphi 5 that uses BDE to access the SQL Server database. This application normally ran on a Windows Server 2012.
The product has undergone an infrastructure change, and now runs on other 64-bit Windows Server 2012 and 2016 VMs (previous machines no longer exist). From this change customers began reporting the error:
Insufficient memory for this operation.
All customers report that previously the problem did not occur.
Important! This error only occurs when selecting a large number of records. For example, a product query that returns more than 45,000 records, with 150 columns, multiple text and 1 blob.
Again, customers claim that this problem did not occur before the change.
I have already run through many blogs, forums, StackOverflow itself, and made many configurations in BdeAdministrator, mainly in the parameters of SHAREDMEMSIZE and SHAREDMEMLOCATION. All possible combinations that I found by Google were tested unsuccessfully. I even installed the EMET tool in an attempt to address the Address Space Layout Randomization (ASLR) problem to no avail.
The default combination: SHAREDMEMSIZE = 4096 and SHAREDMEMLOCATION = 0x5BDE and several others have already been set and had no effect.
Tracking the application execution through the Windows Task Manager, it consumes memory until it reaches 609 Mb when the error happens. I noticed that this memory consumption is the same even with smaller parameters for SHAREDMEMSIZE and SHAREDMEMLOCATION, among other BDE parameters. The application always reaches 609 Mb and the error occurs.
What more could I try to solve this problem? Does anyone have a complementary tip?
I know that BDE is a very (very) old technology, but the system is very large and complex and I can't currently port to another technology.
Solution 1:[1]
We had a similar problem but resolved it by adjusting these three registry entries to match the old server:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Borland\Database Engine\Settings\System\INIT
MAXBUFFERSIZE, REG_SZ, 8192
MEMSIZE, REG_SZ, 128
SHAREDMEMSIZE, REG_SZ, 16348
New server registry:

Old server registry:

Regardless of those settings I also noted our SHAREDMEMLOCATION entry is empty, by setting it to a particular address maybe you are also limiting available memory.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Nick stands with Ukraine |
