Posted By: commander TOracleDataSet Refresh Memory Increase - 09/28/07 01:12 PM
delphi 2005, doa 4.0.7.1, oracle 10.0.2.1 db/client

i use a TOracleDataSet with TDataSource, about 30 Fields and 50 rows per refresh.
any time i do a Toracledataset.refresh and i do almost every second my process memory increases 16KB. this results in an out of memory case after a couple hours of running my application.

i tried to change readbuffer from 25 downto 1, but theres is still a memory increase of about 4KB.

please help, i
Could you create a sample app for this ??

Greetings
Jens
As a test, what happens if you repeatedly run (Execute + Next until Eof) the same query in a TOracleQuery instance?
Posted By: commander Re: TOracleDataSet Refresh Memory Increase - 10/02/07 03:18 PM
here is a sample tested in delphi 2005 or 2006:

vcl form with two tbuttons, toracledataset (ods), tdatasource (ds), toraclesession (os):

procedure TForm1.Button1Click(Sender: TObject);
begin
if ods.Active then ods.Close else ods.open;
{ the same with active true/false }
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ods.refresh;
end;
{ refresh has the biggest memory consumption }
or try
procedure TForm1.Button2Click(Sender: TObject);
begin
ods.first;
while not ods.eof do
begin
inc(c);
ods.RefreshRecord;
ods.next;
end;
end;

when you hit button2 about 10/20 times you can see memory increasing in the task manager.
refresh is very obvious, refreshrecord less

when you connect a dbgrid with the datasource the memory increment can be about 16k per click.

i played with compiler directives, i tried delphi 2005 and 2006 on two machines and all the same.
since i need to refresh my db data very often its really a problem because when the application runs about 8 hours it takes about 1gb of memory !

thanks in advance for your help :-)

claus reinhardt
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 10/14/08 09:43 PM
Was this ever resolved? If so in which version?

I'm having the same issue in 4.0.7 If you sit and watch Task Manager while it refreshes (the TOracleDataset) the memory use seems to remain fairly constant, but if you try to do other things (open Word, etc.) while the refresh process is running memory use creeps up.

To replicate I've simply put a timer on a form that runs every 15 second to refresh a dataset of 1000 rows (table does have 75 columns with a mixture of types). Has taken me a while to trace the problem as it was affecting customers in a large application with a few 3rd party controls, but as the test app has nothing other than an Oracle dataset, button and a timer I'm now convinced the problem is on refresh.

Thanks
No, this was not reproducible. It would be strange if external factors like MS Word would affect this.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 10/15/08 03:39 PM
I've upgraded to 4.1 and this is still happening, strange though it may be, it is definitely dependent on other apps. This is why it has taken me so long to trace the cause. I do not know if this is down to them using memory or processor, but would imagine memory.

I'm seeing it increasing by small numbers of k on my development machine by opening Word, closing it, opening Excel, closing it, etc. Out on the customer's machine it is being run on a terminal server and they are seeing jumps of 5Mb up until the machine runs out of memory and falls-over.

example from my machine:
TIME MEM USED
11:18am 14972
11:19am 14976
11:20am 14992
11:21am 15020
11:22am 15040
11:23am 15052
Stopped Doing Anything Else On The Machine
11:23am 15052
11:24am 15052
11:25am 15052
11:26am 15052
11:27am 15052
11:28am 15052
11:29am 15052
11:30am 15052
11:31am 15052
11:32am 15052
Screensaver Kicked In
11:32am 15056
11:33am 15056
11:34am 15056

If you have a database with a large table including blob, number & varchar columns it should be a 5 minute job to replicate.

Should you still not be able to replicate it let me know and I'll try to find the time to write some SQL to create a large table and populate it, then modify my timer app to use it instead.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 10/15/08 09:33 PM
If it is of any help: the same happens if rather than dataset.refresh you call dataset.close then dataset.open
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 11/18/08 06:25 PM
Any update on this Marco? our customers are chasing us for a fix to this issue.
Not really. If you can send me a demo application and the necessary steps to reproduce this, we can give it another look.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 11/19/08 08:52 PM
Sample app and instructions are heading your way Marco.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 01/27/09 09:14 AM
Any update on the Marco? Not heard anything since sending the sample app (over 2 months ago).
Don't want to redo a couple of million lines of code to use a different dataset if I can avoid it.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 04/23/09 03:11 PM
That's almost another 3 months. Any chance of some feedback?
Sorry, I lost track of this. I will look into the status of this issue.
Posted By: Robertio Re: TOracleDataSet Refresh Memory Increase - 06/26/09 10:09 AM
Any update Marco - customer was on about this earlier in the week as a single instance of the app was using over 80Mb and the terminal server was less than entirely happy.
© Allround Automations forums