Bonjour, Voici le code suivant :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
procedure TFrmTest.TestMemoire;
var TWork : TSQLQuery;
    MontantRegl : Double;
 
begin
  Stop:=false;
  TWork := TSQLQuery.Create(nil);
  Try
    TWork.SQLConnection := dmdMainExpress.dbMain;
    TWork.Sql.Text :='select * from facture_fac';
    TWork.Open;
    while (Not TWork.eof) and (not stop) do
    begin
      MontantRegl := TWork.FieldByName('FAC_ID').AsDouble;
      TWork.next;
    end;
    showmessage(currtostr(MontantRegl));
  Finally
    TWork.Close;
    freeandnil(TWork);
  End;
 
end;

Lors du freeandnil, la mémoire utilisé par mon exe ne rebaisse pas : Je ne comprend pas pourquoi!

Merci de m'aider.