Memory Not Released after saving DB file lazarus / 16-Databases ---------------------------------------------------------------------- egsuh · 2021-08-03 09:33 Hi, I'm using TcsvDataSet just to save it as CSV file. (I know DBExport package, but just want to install minimum).  Only when this procedure is executed there are memory blocks not released as in the attached file. Not sure whether this is DB issue or LCL issue. bdsSampleList is TBufDataSet. I'm not using TCSVDataSet directly because other parts were done with TBufDataSet (recently found SavetoCSVFile procedure).  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TSampleList.mniSaveClick(Sender: TObject);var   csv: TCSVDataSet;begin   if sd1.Execute then begin      csv:= TCSVDataSet.Create(nil);      with csv do begin         CopyFromDataset(bdsSampleList);         CSVOptions.FirstLineAsFieldNames:= True;         SaveToCSVFile(sd1.FileName);      end;      FreeAndNil(CSV);      ShowMessage('SampleList exported');   end;end; ---------------------------------------------------------------------- bytebites · 2021-08-03 11:12 https://forum.lazarus.freepascal.org/index.php?topic=49096.0 ---------------------------------------------------------------------- egsuh · 2021-08-03 12:39 I’m happy not to spend much time seaeching for my own mistake.