fastmm

How to solve memory segmentation and force FastMM to release memory to OS?

我是研究僧i 提交于 2019-12-05 00:30:35
问题 Note: 32 bit application, which is not planned to be migrated to 64 bit. I'm working with a very memory consuming application and have pretty much optimized all the relevant paths in respect to memory allocation/de-allocation. (there are no memory leaks, no handle leaks, no any other kind of leaks in the application itself AFAIK and tested. 3rd party libs which I cannot touch are of course candidates but unlikely in my scenario) The application will frequently allocate large single and bi

How can I enable the memory leak tracking with FastMM in DUnit?

心不动则不痛 提交于 2019-12-05 00:05:14
In the GUI test runner, the menu items for memory leak checking are inactive (grayed out). Is there a special switch I have not found yet to activate them? Using DUnit 9.4 (from Delphi 2009 or from the sourceforge Subversion repository) and FastMM4.92 You have to build your DUnit GUI-testrunner with the FASTMM and ManualLeakReportingControl directive. This will enable the memoryleak items (Take a look in GUITestRunner.pas). 来源: https://stackoverflow.com/questions/685904/how-can-i-enable-the-memory-leak-tracking-with-fastmm-in-dunit

FreeMM vs ShareMem

梦想的初衷 提交于 2019-12-04 09:49:02
We have a lot of dll-libraries written in both delphi and c++ builder, and use sharemem and borlndmm.dll. An aligment-issue in a 3thparty library forces us over to the new memorymanager in delphi 2007. Can someone please explain 'shared memory manager' for me? Is SimpleShareMem a dropin replacement for ShareMem ? Can we then stop deploying borlndmm.dll? Do we have to do something with the c++-libraries as well? Can some libraries use ShareMem and some SimpleShareMem? Thanks, -Vegar I think I found the answer to most of my questions in this thread: borland.public.delphi.language.basm : Either

How to solve memory segmentation and force FastMM to release memory to OS?

こ雲淡風輕ζ 提交于 2019-12-03 15:34:40
Note: 32 bit application, which is not planned to be migrated to 64 bit. I'm working with a very memory consuming application and have pretty much optimized all the relevant paths in respect to memory allocation/de-allocation. (there are no memory leaks, no handle leaks, no any other kind of leaks in the application itself AFAIK and tested. 3rd party libs which I cannot touch are of course candidates but unlikely in my scenario) The application will frequently allocate large single and bi-dimensional dynamic arrays of single and packed records of up to 4 singles. By large I mean 5000x5000 of

FastMM4 says “The block header has been corrupted”

拥有回忆 提交于 2019-12-03 13:44:44
问题 I had this nasty bug that disappeared in the past but now after quite some time it returned. I have two TSam objects (derived from TPersistent) created and loaded into an TAsmJob object (derived from TObjectList). At runtime, a form creates a TStringGrid and then the AsmJob which creates those two SAM objects (and load some data from disk in each of them). The AsmJob is also assigned to the grid. When the form is destroyed, the Grid takes care of the AsmJob by freeing it, which frees the TSam

FastMM4 says “The block header has been corrupted”

╄→尐↘猪︶ㄣ 提交于 2019-12-03 03:44:53
I had this nasty bug that disappeared in the past but now after quite some time it returned. I have two TSam objects (derived from TPersistent) created and loaded into an TAsmJob object (derived from TObjectList). At runtime, a form creates a TStringGrid and then the AsmJob which creates those two SAM objects (and load some data from disk in each of them). The AsmJob is also assigned to the grid. When the form is destroyed, the Grid takes care of the AsmJob by freeing it, which frees the TSam objects. Here is the problem: the first object is freed withot problems but the second one dies when

How to free TOleStream in this bit of code

天涯浪子 提交于 2019-11-30 21:11:38
This is from a custom namespacer handler done in Delphi I use to load files into a webbrowser component. Datastream:IStream; var F: TFileStream; Dummy: INT64; begin F:=TFileStream.Create(strfilename fmOpenRead); CreateStreamOnHGlobal(0, True, DataStream); TOleStream.Create(DataStream).CopyFrom(F, F.Size); DataStream.Seek(0, STREAM_SEEK_SET, Dummy); TotalSize := F.Size; F.Free; end; The problem is that Fastmm4 gives a memory leak error when the program ends and says that TOleStream was not freed. How do I free it? If I put TOleStream in a variable and assign like this var TOS:TOleStream; TOS:

FastMM: Total Allocated Memory

♀尐吖头ヾ 提交于 2019-11-30 20:22:35
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 FastMM allocated memory plus some system overhead. Am I wrong? Use this: //-----------------------------

Does FastMM detect all memory leaks

懵懂的女人 提交于 2019-11-30 15:33:42
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 intercept? I will do a search in my code for them. Thanks. Delphi 7, Win 7 32 bit FastMM 4.97 I am not

delphi - terminate all the threads (TThread) on closing application

走远了吗. 提交于 2019-11-30 05:28:34
My application is a tcp/ip server, with main thread created only once & listening all the time. When new client connects, the main thread creates the new thread of TClientThread type. There is however no list of running Client threads, as that would make my app a bit complicated... is there any way to execute "terminate" method on all the threads, even if the thread is busy (in my case "busy" means it's waiting for the data, where the timeout set is about 30 sec ... so I have to kill it anyway, without waiting.)? The simple closing application seems not to run "terminate" method on the threads