Memory problem in 3-tier Delphi application

I'm having problems with a 3-tier application I've developed using Delphi 7. This application has a process that involves heavy queries. After saving the data from this screen and performing a query from the same screen right after saving, I'm getting the following errors:
"Invalid authorization specification"
"Not enough storage is available to complete this operation"

Application Server
"Error reading qryXXXXX. CommandText: Out of memory."

qryXXXXX is the name of the TADODataSet component this process uses.

The appication server runs in a separate box, about 30 clients connect to the same app server. My guess is that there are some memory leaks that are cosuming resources on this machine.

Unless you have different ideas about this problem, I'd appreciate you let me know about any unit (that I can integrate to my application) that generates a log with all memory leaks. I remember a friend of mine including a unit like this in other application, unfortunatelly I lost the code as well as the contact with this friend but that is a different story ;)

Thanx in advance for any help.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I have used memcheck from

with some success


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Check out following article:,1410,28344,00.html

or just use a mem-leaks tracking tool (as pcsentinel suggested).
There also are:
  AQTime ( and
  BoundsChecker ( trial downloads.

Sometimes it pays to consider a replacement memory manager too, especially if your mid-tier server is multi-threaded. Some comercial alternatives are BigBrain see and NexusDB see I think both have a limited feature free versions. There are also some open source versions, etc.

You don't mention how you mid-tier sever is constructed, your code or based on a framework such as Asta or RemObjects. IMO, rolling your own is probably a bad idea. You mention 30 clients, but there is no clue as to what you allocate on a per client basis. I know Asta has a thread-pool that serves most users with limited threads (RemObjects probably does too, just have not used it as much, it is newer) -- This kind of architecture can make a big difference in scalability.

Codesite is also useful in debugging, but you will to embed suitable calls to codesite to take advantage.



Just thinking out of the box here...

>>"Not enough storage is available to complete this operation"

Do you have enough free space on the drive where your Temp directory exists?

Database engines and ODBC drivers of all descriptions write Temp files to your temp directory - particularly with complex and large data applications.

These messages are often misleading (they are only what the programmmer thought would be the error). When you make calls to functions that  'call functions' you can get erroneous messages.  I don't mean spaghetti code here - I am referring to e.g A function that deletes records from a database - the function calls the function '.delete' . These types of operations frequently give bad/mad messages

If you run out of stack the message is usually 'out of stack' or similar - not the message you describe.

Likewise, if your machine hasn't physically stopped then you are not actually out of memory.

Borland's memory manager isn't the greatest any way - try FastShareMem  It's freeware and works for me.

The other thing is the question 'which machine is the error occurring on?' The Server or the Client?  

Isolate the problem by putting msgboxes in your code before calls so you can see what is happening - its an old method but a goody.

Best Wishes

Pierre CorneliusCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
- Split PCSentinel, Illusion_chaser, gwalkeriq and Voodooman

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.