I have a Delphi 11 application that does basic Extract / Transform / Load. I am using UniDAC from DevArt for the database connections. I am running on Windows server... I am reading from an Oracle DB and writing to a MSSQL database.
I have never encountered this before - but it is the first time we are doing over 7 million records from an Oracle DB.
Basically - I have two UniConnections (Oracle and MSSQL) - and a few UniQueries to handle the read from the Oracle and the Insert into MSSQL.
The problem is that the program just keeps consuming more and more memory - until I get to about 3.5 million records - at which point I get out of memory errors. The machine has 16 GB of memory
I have tried all sorts of things - closing and opening the UniQueries every 500 records, I have tried also closing and opening the UniConnection - and nothing works. I figured if I was closing the database connection - then it should free up the memory for those objects - but it does not look like it is doing that. I even tried freeing the UniQueries and recreating and reopening them - still the same problem. It is not until I CLOSE the application that the memory is finally freed.
I have run Deleaker and it is not reporting any memory leaks... I am at a loss as to what is causing this! It is a fairly straight forward ETL program - no memo fields, just strings, numbers and date fields. No big processing just combining some strings and then writing it to the MSSQL table.
For the Delphi folks out there - if you close a TQuery should not the memory that was used by it be reclaimed? What if you free the object?
Any thoughts would be appreciated as where else I can look? I am getting to the point where I will have to run the program for a subset of the records - close it - then open it again and run it for the next 'X' records - and repeat until I complete all of them... But this is a short term solution and I need a real fix.
Thank you
Bradley MacDonald