Ian Branch 127 Posted March 7, 2022 Hi Team, D11. I am playing with TFDMemTable. I have the following line of code... FDMemTable1.CopyDataSet(Company, [coStructure, coAppend]); Company is previously filtered so there is only one record 'visible'. How can I tell how much memory has been used as a result of just this code/action please? Regards & TIA, Ian Share this post Link to post
Der schöne Günther 316 Posted March 7, 2022 I had the same question a few years back. The TClientDataSet had a somewhat plausible DataSize property, but the FireDAC memory table had no such thing. A rather desperate approach would be saving the entire memory table into a stream and then determining the stream size which is rather silly and does not necessarily reflect how much the data actually takes up in your memory. Share this post Link to post
Lajos Juhász 293 Posted March 7, 2022 4 hours ago, Der schöne Günther said: A rather desperate approach would be saving the entire memory table into a stream and then determining the stream size which is rather silly and does not necessarily reflect how much the data actually takes up in your memory. The memory required for the stream doesn't have to be the same as for internal representation for the data. The only way to firure out is to query the memory manager before and after the operation. Share this post Link to post
Der schöne Günther 316 Posted March 7, 2022 I don't think comparing "memory usage before" and "memory usage after" in a release build is going to yield anything useful. There might be a lot of other things going on in separate threads. 1 Share this post Link to post
SwiftExpat 65 Posted March 7, 2022 2 hours ago, Der schöne Günther said: I don't think comparing "memory usage before" and "memory usage after" in a release build is going to yield anything useful. I would agree with not much useful here. What is the threshold you are willing to allow for that memtable? What level of precision are you looking for? Task Manager / Perfmon will get you close enough. Share this post Link to post
Pat Foley 51 Posted March 7, 2022 (edited) Task Manager mentioned in Cary Jensen's question on SO about fd copydatasset memory issue. https://stackoverflow.com/questions/61018590/is-there-a-solution-to-the-firedac-copydataset-and-copyrecord-memory-loss Edited March 7, 2022 by Pat Foley Add Picture Share this post Link to post
Fr0sT.Brutal 900 Posted March 9, 2022 Use FastMM which has extended diagnostics about what it allocated and compare values before/after Share this post Link to post