Procedure TForm1. Button2Click (Sender: TObject);
The begin
ADOQuery3. CacheSize:=1000;
ADOQuery3. CursorLocation:=clUseServer;//server mode
ADOQuery3. Open;
While not ADOQuery3. Eof do
The begin
Memo2. Lines. The Add (' 1 ');
ADOQuery3. Next;
end;
Memo2. Lines. The Add (" end ");
Adoquery3. Cancel;
ADOQuery3. Close;
ADOQuery3. Free;
ADOConnection1. Close;
ADOConnection1. Free;
end;
Code like this is very simple, but why when after loading the data, the native memory footprint is not released?? All normal close, use clUseClient won't have this problem, but my data volume is big, need to use clUseServer, and observe the oracle cursor open at this time also many, also did not release,
CodePudding user response:
Beg beg,CodePudding user response:
Dynamically create a Adoquery tryVar
Ado_query: tadoquery;
The begin
Ado_query:=TADOQuery. Create (nil);
After use release
CodePudding user response: