Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

memory leak?

Status
Not open for further replies.

drdb

Programmer
May 22, 2003
9
NG
I have written a delphi program that posts information to a database. The program was orginally written for Paradox, but has now been converted to MSSQL. This is where the problem began. The program is in a production enviornment and runs six days a week 24 hours per day. Since I've changed the program using ADO components and running all queries instead of open bde tables. Every since the change after about two days of running, the computer gets an out of memory error and has to be rebooted.

Is there anyway I can log or otherwise monitor to try and find this memory leak?

Any help would be extreamly helpful.
thanks in advance
 
You stated that the program was originally written for paradox and now it has been converted for MS-SQL

1) You are using queries instead of tables, good

2) Are you doing the data processing on the Server (preferred) or on the client (your application)?

3) Have you converted the data structure in paradox for being used by SQL-Server? Things like triggers, stored procedures and referential integrities unleash the real power of client-server systems.

4) Is it a delphi (your application) problem, the SQL-Server or the network?

5) Is the server running on the same computer as the application?

There is a SQL Monitor tool that can be used to track the traffic between the app and the server (although have not used it yet).

Steven van Els
SAvanEls@cq-link.sr
 
For memory leak detection try
Boundschecker - comprehensive commercial tool
Borland's Code Central - mention of (free) leak detection code, but I have not tried any of them.

These programs clasically check that memory allocated by your program is freed by the time the program exits, in which case they may not detect your problem.

From what you say about your app, I suggest:
1. Check that all datasets are closed as soon as they are finished with.
2. Think - is there anywhere in the application where multiple instances of an object are created. Check that these instances are being properly and promptly freed.

Lastly, you could include a monitor of how much memory your program is using. I think I did this once, but sorry, I can't remember how. Then run the program in a controlled environment and note which operations leave memory used increased after they have finished.

Good luck
Simon
 
The data processing is running server side now, it wasn't before the change. I've checked to see what instances of obj's might not be getting freed, but had no luck finding any. I'll will have another team programmer look at it also just in case.

I'm going to try the mem monitor idea as the one boundschecker like app didnt find anything

Thanks for the suggestions
I'll post the results
Scott
 
Don't know which version you're using but Delphi 6 had a bug, (see
Info:
Area: database\dbexpress\tsqldataset
Reference Number: 114136

Status: Fixed in Delphi 6 Update Pack
Date Reported: 6/11/01

Severity: Serious

Type: Basic Functionality Failure

Problem:

SQLDataSet.Refresh causes memory loss.


Hope this helps...

Good luck,

Mark.
PAC Greenware
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top