fastmm

FastMM: Total Allocated Memory

泄露秘密 提交于 2019-11-30 05:06:44
问题 How could I get the total amount of memory, that allocated by FastMM? I've tried that: function GetTotalAllocatedMemory: Cardinal; var MMState: TMemoryManagerState; begin GetMemoryManagerState(MMState); Result := MMState.TotalAllocatedMediumBlockSize + MMState.TotalAllocatedLargeBlockSize; end; Is it correct? Anyways it returns something strange. It 5 times less than a value which I can see in Windows task manager. I believe that the amount of memory allocated by a Delphi application equals

Does FastMM detect all memory leaks

﹥>﹥吖頭↗ 提交于 2019-11-29 22:13:08
问题 Somebody suggested recently ( My program never releases the memory back. Why? ) that my program leaks some memory. I have FastMM set to aggressive and it reports no memory leaks when I shutdown the program. Anyway, I would like to know if there can be memory leaks that are no detected by FastMM? Update: I don't personally use Win API to allocate memory. But I am afraid that some 3rd party components I use (not so many) may use it. Can you let me know all possible API calls that FastMM cannot

How do I turn on/off FastMM memory leak reporting under Delphi XE?

烂漫一生 提交于 2019-11-29 11:28:26
How do I turn on/off FastMM memory leak reporting under Delphi XE? Under Delphi 7, I had to modify the inc file. But I hear that Delphi XE has FastMM already integrated. How do I access FastMM settings? I got this from Delphi Help: Full source code for the Memory Manager (FastMM) is available on SourceForge. With the full version of FastMM, you can run the memory manager in a special "debug" mode which is useful for detecting heap corruption and memory leaks. Additional features in the full version of FastMM: Double free objects / interfaces File logging and reports For more information,

How to convince the memory manager to release unused memory

断了今生、忘了曾经 提交于 2019-11-29 07:28:50
In a recent post ( My program never releases the memory back. Why? ) I show that when using FastMM, the application does not release substantial amounts of memory back to the system. Recently I created an artificial test program to make sure the issue it is not a memory and that it only appears with FastMM. In this program I create and destroy an object (same as the one used in the previous post) 500 times. The memory requirements are ("Private working set"): Without FastMM Before running the loop: 1.2MB After running the loop: 2.1MB With FastMM (aggressive debug mode) Before running the loop:

How to track down tricky memory leak with fastMM?

≯℡__Kan透↙ 提交于 2019-11-29 06:58:33
After upgrading a project from Delphi 2007 to Delphi 2009 I'm getting an Unknown memory leak, so far I've been tryin to track it down using fastMM, here is what fastMM stack trace reports: A memory block has been leaked. The size is: 20 This block was allocated by thread 0x111C, and the stack trace (return addresses) at the time was: 40339E [System.pas][System][@GetMem][3412] 534873 [crtl][_malloc] 56D1C4 [canex.cpp][MidasLib][DllGetDataSnapClassObject][3918] 56D316 [canex.cpp][MidasLib][DllGetDataSnapClassObject][3961] 56D5EE [canex.cpp][MidasLib][DllGetDataSnapClassObject][4085] 562D48

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

陌路散爱 提交于 2019-11-28 08:30:32
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 and release cycle. e.g.: 1,456 KB used after starting my program with no dataset. 218,455 KB used after

How do I turn on/off FastMM memory leak reporting under Delphi XE?

谁说胖子不能爱 提交于 2019-11-28 04:40:08
问题 How do I turn on/off FastMM memory leak reporting under Delphi XE? Under Delphi 7, I had to modify the inc file. But I hear that Delphi XE has FastMM already integrated. How do I access FastMM settings? I got this from Delphi Help: Full source code for the Memory Manager (FastMM) is available on SourceForge. With the full version of FastMM, you can run the memory manager in a special "debug" mode which is useful for detecting heap corruption and memory leaks. Additional features in the full

How to convince the memory manager to release unused memory

走远了吗. 提交于 2019-11-28 01:03:10
问题 In a recent post ( My program never releases the memory back. Why? ) I show that when using FastMM, the application does not release substantial amounts of memory back to the system. Recently I created an artificial test program to make sure the issue it is not a memory and that it only appears with FastMM. In this program I create and destroy an object (same as the one used in the previous post) 500 times. The memory requirements are ("Private working set"): Without FastMM Before running the

How to enable full debug mode in FastMM4?

江枫思渺然 提交于 2019-11-27 14:43:41
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I cannot figure out how to use FastMM. I have downloaded it from SourceForge and placed FastMM4Messages.pas and FastMM4.pas at the top of my dpr file. I now call this procedure to leak some memory: procedure testMemoryFastMM; var str : TStringList; begin str:=TStringList.Create; str.add('MemChk'); str.SaveToFile('C:\leeMemChk.txt'); end; and get this message

How to get the Memory Used by a Delphi Program

旧时模样 提交于 2019-11-27 10:16:35
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. It produced identical results to the GetHeapStatus function (now deprecated) that I used to use,