[Solved] Filter dataset, memory growing up? lazarus / 16-Databases ---------------------------------------------------------------------- lainz · 2019-06-20 22:49 I have a dataset (Offers: TBufDataset;) where I have stored all "discounts & offers". Offers.Filter := 'type = 0' Offers.Filtered := True; We have 9 kind of offers. The dataset is Filtered to look for the kind of offer, say offer type 0, offer type 1, and so on. That procedure grows a lot the memory usage of the program every time is called. If I remove the filter lines, saying there are no offers, there is no leak. It can be that filtering can cause memory grow, but no memory leak is found at the end of the program? ---------------------------------------------------------------------- valdir.marcos · 2019-06-22 16:29 Quote from: Lainz on June 21, 2019, 12:49:47 amI have a dataset (Offers: TBufDataset;) where I have stored all "discounts & offers". 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 Offers.Filter   := 'type = 0'Offers.Filtered := True;We have 9 kind of offers. The dataset is Filtered to look for the kind of offer, say offer type 0, offer type 1, and so on. That procedure grows a lot the memory usage of the program every time is called. If I remove the filter lines, saying there are no offers, there is no leak. It can be that filtering can cause memory grow, but no memory leak is found at the end of the program?Could you provide a small sample project? ---------------------------------------------------------------------- lainz · 2019-06-22 23:52 Sure, here is a test project that shows the memory growing bug. On my machine is about 100 kb per second the quantity of memory that grows and then never comes back (looking at the task manager on Windows 10). Edit: to see memory growing faster, increase the number of records generated to 10000. But take into account that maybe you need to kill the application then. ---------------------------------------------------------------------- lainz · 2019-06-23 15:10 Reported in bugtracker https://bugs.freepascal.org/view.php?id=35756 ---------------------------------------------------------------------- lainz · 2019-06-23 21:15 Well it was solved as 'Memory Fragmentation' or 'blame the DBGrid'. With no DBGrid it still increases memory, so it must be the first choice. I close this since no one will fix it, because "there are no leaks", but memory increases anyways, so better not use filter like I'm doing in the example. ---------------------------------------------------------------------- lainz · 2019-06-25 02:09 Reopen. Thanks to BrunoK for opening a new issue with a fix https://bugs.freepascal.org/view.php?id=35759