Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

EDBEngineError: Insufficient memory for this operation.

Posted on 1997-05-19
6
Medium Priority
?
1,710 Views
Last Modified: 2012-06-21
I have a report from a Beta test system (running my D2 app) with the above exception. I am stumped. This only happens about once a day.
The procedure in my code where this occured, does nothing special. It does the following operations on a Paradox table:

with myTable do
begin
      IndexFieldnames := 'Dati';
      Filter := sMyFilter;
      Filtered := True;
      if FindFirst then
            if (Fields[1].Value > tMyDati) then
                  Result := False
            else
            begin
                  GetThisRecord;
                  Delete;
                  Result := True;
            end
      else
            Result := False;
      Filtered := False;
      Filter := '';
end;

This piece of code gets called repeatedly.

Am I running out of heap or stack or what is going on here?

How do I get the DB unit to compile with debug info on so that I can find the exact location of this exception?

0
Comment
Question by:abeldup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:icampbe1
ID: 1336459
You dont say if you have an OnFilterRecord event and if so, what it looks like.  I believe if you move/copy the BD source unit locally, it will compile with your code.  I get confused with this sometimes.  You might have to put a path to it in your project|directories options.  
0
 

Author Comment

by:abeldup
ID: 1336460
No, there is no OnFilterRecordEvent.

This piece of code gets called repeatedly in a TTimer event. The application gets re-started every night at 23:00 and crashes at approx. 10:30 the next morning.

Could this be a memory leak problem? I have searched the Borland BDE site and all I could come up with is that this error falls in the 'Resource or Limit Error' category.

TIA

0
 
LVL 2

Expert Comment

by:icampbe1
ID: 1336461
I know you are showing me pseudo code, but just to be sure, when you say 'FindFirst', do you mean FindFirst as in the directory search FindFirst/FindNext??  Or do you mean a DB FindFirst in your Dataset?   If it is the former, do you have a FindClose at the end??   This is just a long shot.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:abeldup
ID: 1336462
No, you're on the wrong track there. I am using the TTable's FindFirst.
I have since trapped the exception and this is what the call stack looked like:

DbiError
Check
TDataSet.CreateExprFilter
TDataSet.SetFilterData
TDataSet.SetFilterText
mysubroutine
TTimerEvent

Stepping through the code in the DB unit, I have seen that a filter parsing object is created everytime.

I seem to remember seeing a posting somewhere on memory leaks when using filters on TTable.
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 200 total points
ID: 1336463
probably by calling 'GetThisRecord' you created a bookmark, therefore, allocated memory for this bookmark and didn't free it.
note, every time you use 'GetBookmark' method you allocate memory. if you dont free it you'll get lots of unnecessary bookmarks. After you use 'GoToBookmark' you should free it this way:
Table1.FreeBookmark(BookMark);
BookMark:=nil;
0
 

Author Comment

by:abeldup
ID: 1336464
No, I do not use bookmarks in my subroutine GetThisRecord. Good tip though.
I have since determined that the leak was caused by the BDE creating a new filter parsing object everytime and not releasing it. I was able to avoid this leak by changing the code to:

with myTable do
begin
    IndexFieldnames := 'Dati';
    Filtered := True;
    Filter := sMyFilter;
    if FindFirst then
        if (Fields[1].Value > tMyDati) then
            Result := False
        else
        begin
            GetThisRecord;
            Delete;
            Result := True;
        end
        else
            Result := False;
    Filter := '';
    Filtered := False;
end;

So by swopping those lines the problem was fixed!

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question