delphimemory-managementdelphi-2006

Strategy or tools to find "non-leak" memory usage problems in Delphi?


One old application started to consume memory a lot after server update. Memory usage seems to rise with out limit until program hangs.

According to FastMM4 and EurekaLog, there's no memory leak (except 28 bytes), so I assume all memory is freed when application is shutdown.

Are there any tools or strategies suitable for tracking this kind of memory problem?


Solution

    1. The growing memory consumption is an application issue. It is not a bug, which can discover FastMM4 or EurekaLog. As from they point of view - application just correctly uses the memory.
    2. Using AQTime, MemProof (hard to find, D7 is last supported version (?)), SleuthQA (similar to MemProof) or similar memory profilers, you can track the memory usage outside of application in real-time.
    3. Using FastMM4, GetMemoryManagerState / GetMemoryManagerUsageSummary you can track memory usage from application. Output this information into trace file and analyze it after run. Or make simple wrapping function for one of the above procedures, which will return curent memory usage. And call it from IDE Debugger Evalute / Modify, add to Watches or call OutputDebugString, and see the current memory usage.

    Note, if memory is eated by some DLL then you may not see her memory usage using (3). Use (2).

    Analyzing the memory usage and the tasks performed by the application, you may discover what leads to raised memory usage.