fastmm

Delphi - structures' strings not being freed [FastMM manager]

﹥>﹥吖頭↗ 提交于 2020-03-01 06:41:52
问题 If I declare PSomeStruct = ^TSomeStruct; TSomeStruct = record s1 : string; end; and I run the following code: var p: PSomeStruct; begin new(p); p^.s1:= 'something bla bla bla'; dispose(p); the FastMM 4 memory manager reports that there was a memory leak (type: string, data dump: "something bla bla bla"). However, if I do set the s1 string to empty before calling dispose it's OK. The second way I found is to change from record type to class, then instead of new I'm creating the instance, and

What could explain the difference in memory usage reported by FastMM or GetProcessMemoryInfo?

非 Y 不嫁゛ 提交于 2020-01-23 11:08:16
问题 My Delphi XE application is based on a single EXE using a local server DLL created by RemObjects and uses a lot of memory for a specific operation until it generates an exception saying there are not enough memory. So I'm trying to understand why and where this is happening so I placed various steps throughout my code where I report on memory usage. The problem is that I'm getting very different information based on the method used to get memory usage information: If I use the method

How to free TOleStream in this bit of code

那年仲夏 提交于 2020-01-11 02:40:07
问题 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

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

霸气de小男生 提交于 2020-01-10 09:22:51
问题 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

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

◇◆丶佛笑我妖孽 提交于 2020-01-10 09:21:21
问题 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

How to track down tricky memory leak with fastMM?

霸气de小男生 提交于 2020-01-10 02:55:47
问题 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]

delphi 7, FastMM4 cannot install work around

独自空忆成欢 提交于 2019-12-25 05:16:21
问题 i am working on an application that uses FastMM4 , from sourceforge.net. So i have added the FastMM4.pas to the uses clause right at the beginning. In the application i need to run a batch file after FinalizeMemoryManager; in the finalization of unit FastMM4; like this initialization RunInitializationCode; finalization {$ifndef PatchBCBTerminate} FinalizeMemoryManager; RunTheBatFileAtTheEnd; //my code here..calling a procedure {$endif} end. then my code for RunTheBatFileAtTheEnd is :

How do I get access to FastMM4's RegisterExpectedMemoryLeak?

泪湿孤枕 提交于 2019-12-24 04:28:07
问题 I'm using Delphi's fastMM memory manager and I fail when I try to use the full debug mode. I get the following errors when compiling: FastMM\FastMM4.pas(6872) Error: Undeclared identifier: 'RegisterExpectedMemoryLeak' FastMM\FastMM4.pas(6948) Error: Undeclared identifier: 'UnregisterExpectedMemoryLeak' FastMM\FastMM4.pas(9269) import_test.dpr(24) Fatal: Could not compile used unit 'FastMM\FastMM4.pas' The .inc file tells to load the full debug dll. I've already copied the FastMM_FullDebugMode

How to obtain the names of custom-made structures whose instances have leaked memory?

て烟熏妆下的殇ゞ 提交于 2019-12-21 03:32:31
问题 I am working a on parser which will go through a FASTMM4 memory leak report and store all relevant data in a custom-made structure/class. I use VirtualTreeView to display each class that has leaked instances as a node in the tree. The tree - Notice that the FIRST node says unknown. This is because FASTMM calls a method AClass to determine weather it is a class or not. When it finds custom structures, it marks them as unknown, which doesn't make my report analyzer very effective since most

FastMM4, Delphi6, Leak of TApplication?

℡╲_俬逩灬. 提交于 2019-12-18 08:51:10
问题 I checked the FastMM4 with D6. When I debug a simple application with uses "Forms", I everytime got 3 lines for memory leak. This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer): 13 - 20 bytes: TObjectList x 3, Unknown x 3 29 - 36 bytes: TWinHelpViewer x 1 37 - 52 bytes: THelpManager x 1 Is this normal? Which thing causes this? Thanks: dd 回答1: The RTL/VCL that ships with Delphi 6 contains some memory leaks. In later releases of Delphi