fastmm

Why does my Delphi program's memory continue to grow?

浪尽此生 提交于 2019-11-27 02:21:51
问题 I am using Delphi 2009 which has the FastMM4 memory manager built into it. My program reads in and processes a large dataset. All memory is freed correctly whenever I clear the dataset or exit the program. It has no memory leaks at all. Using the CurrentMemoryUsage routine given in spenwarr's answer to: How to get the Memory Used by a Delphi Program, I have displayed the memory used by FastMM4 during processing. What seems to be happening is that memory is use is growing after every process

How to get the Memory Used by a Delphi Program

帅比萌擦擦* 提交于 2019-11-26 15:09:23
问题 I know how to get the System memory use using GlobalMemoryStatusEx, but that tells me the what the entire OS is using. I really want my program to report how much memory it alone has allocated and is using. Is there any way within my Delphi 2009 program to call either a Windows function or maybe some FastMM function to find out the memory that has been allocated by my program alone? Revisiting my question, I have now changed my accepted answer to the GetMemoryManagerState answer by @apenwarr.