Hi,
Using a large field list and a WHERE clause in to call MySQL V5.5 and then using MyQuery.fieldByName function causes a memory leak.
It does appear to depend on the table structure you are calling.
MyQuery := TMyQuery.Create(Nil);
MyQuery.Connection := SQL_C; (connected TMyConnection)
MyQuery.Close;
MyQuery.SQL.Clear;
MyQuery.SQL.Add(' SELECT * ');
MyQuery.SQL.Add(' FROM ');
MyQuery.SQL.Add(' livedata ');
MyQuery.SQL.Add(' WHERE ');
MyQuery.SQL.Add(' VehicleServerID = 1);
MyQuery.Open;
UnitMake := MyQuery.FieldByName('VehicleUnitMake').AsString;
MyQuery.Destroy;
It only appears to affect string values and takes around 8192 bytes on every call.
If you need the table I am using I am happy to send this as an export.
Thanks In Advance
Nigel
Memory leak MyDac 7.1.4 on large field lists
demo code sent
Email with demo code sent
-
AndreyZ
Not the main problem
Hi and thanks,
But the memory is "leaked" on every sql call not just on the connection being left at the end.
Please run the code on table I sent to you and you will see the problem
This is a big problem to me at this time as I have 24/7 systems leaking memory and I have to re-start the applications every day.
Regards
Nigel
But the memory is "leaked" on every sql call not just on the connection being left at the end.
Please run the code on table I sent to you and you will see the problem
This is a big problem to me at this time as I have 24/7 systems leaking memory and I have to re-start the applications every day.
Regards
Nigel
-
AndreyZ
I removed all unnecessary code that allocates memory in your sample (that does not concern MyDAC components), and executed the code where data is read one thousand times. The memory was allocated and freed correctly and there were no memory leaks. I've sent you your sample with my corrections. Please change it to demonstrate the problem with memory.
Update MyDac / SDac
Hi,
Thanks for the example code back, I still got the memory leak but I think it is due to my having both MyDac and Sdac installed, once I removed the SDac the memory leak stopped.
I have run and run the code now and its ok.
I will re-install the SDac and watch the memory usage following that, its a very odd situation.
Many thanks for your input and time during a very frustrating problem.
Regards
Nigel
Thanks for the example code back, I still got the memory leak but I think it is due to my having both MyDac and Sdac installed, once I removed the SDac the memory leak stopped.
I have run and run the code now and its ok.
I will re-install the SDac and watch the memory usage following that, its a very odd situation.
Many thanks for your input and time during a very frustrating problem.
Regards
Nigel
-
AndreyZ