Page 1 of 1

Memory leak on versions 2.50.1.0 and 4.20.0.7

Posted: Tue 26 Feb 2008 14:46
by Romullo
Hi,

We have had problems of memory leaks when we use ftFMTBcd parameters, like the sample bellow:

Query.SQL.Text := 'SELECT * FROM T1 WHERE F1 = :F1';
Query.ParamByName('F1').DataType := ftFMTBcd;
Query.ParamByName('F1').Value := 123;
Query.Open;

If you put this in a loop, 1500 times each interaction on a button click, the memory shown at TaskManager will increase quickly.

In a real application, this is causing "Out of Memory" errors and requiring application restart.

The problem does not happen in Oracle 8 using the driver 2.50.1.0, but it happens with any other configuration, does not matter the Oracle's version or driver's version.

We changed the parameter's DataType to ftInteger (or ftCurrency, or ftFloat, depending on the case), but now the error "EBcdOverflowException: BCD overflow" is happening on Stored Procedures calls.

By doing these tests, we noticed when we use EnabledBCD, the max number of decimal places that is returned from a SELECT statement is 4. With ftFMTBcd parameters we only can INSERT until 4 decimals too, but using ftFloat we can INSERT until the limit of Double precision 15 digits.

We still do not have a work arround for this problem, due to Stored Procedure parameter error.

Any help is welcome.
Thanks.

Posted: Wed 27 Feb 2008 09:29
by Plash
We could not reproduce the problem.
Please supply us the following information
- exact version of Delphi;
- exact version of Oracle server and client.

Also provide the exact code that you are executing, and a DLL statement to create the table.
If it is possible, send to dbxoda*crlab*com a complete small sample that demonstrates the problem, including script to create database objects.

If you use TSQLStoredProc component, you cannot change data type of parameters. But if you use TSQLQuery with PL/SQL block to call the stored procedure, you can set data types that you want.

Posted: Wed 27 Feb 2008 22:44
by Romullo
Hi,

I sent all you need by email right now.

Please confirm if you received the email and the attached file.

Thanks.

Posted: Thu 28 Feb 2008 08:42
by Plash
We have received your email and the attached file.

Posted: Thu 28 Feb 2008 19:16
by Romullo
Hi,

I received an email from Oleg. He said the memory leak was fixed and the fix will be included in the next build. When will be released the next build?

About the stored procedure, if we don't change data type of parameters, the following error happen:

---------------------------
Testcorelab
---------------------------
000000 is not a valid BCD value.
---------------------------
OK
---------------------------

But if we change to ftFMTBcd, no error.

You can test this in the sample I supplied.

Thanks.

Posted: Fri 29 Feb 2008 11:24
by Plash
We are planning to release new DbxOda build in a month.

Please check your sample. You change DataType to ftInteger there. If I comment this line, no error occurs.

Posted: Fri 29 Feb 2008 12:22
by Romullo
If I comment the line that changes the data type to ftInteger, with EnableBCD enabled a exception is raised. Without it enabled no exception occurs, but the parameter in the stored procedure is always zero, instead of the correct value.

I know I can't change the parameter, but if I change it to ftFMTBcd, everything works fine! The procedure in Oracle receive the correct parameter value, no exception in Delphi. I have been using this approach since the version 2.50 of the driver, with no problem until I realize about the leak and it have become a real problem.

I'm anxious for a new build. Until there, I need to restart the server application every day at some customers because of "out of memory" errors. I can't change the code just because the stored procedure calls don't work.

Is it possible to release a beta version? Is there any workaround for the leak using ftFMTBcd, or for the stored procedure problem, while the new driver version isn't released?

Thanks.

Posted: Mon 03 Mar 2008 10:06
by Plash
Please contact us by email, and specify your license number. We'll send you the custom build.