I want to detect memoryleaks in the service application that I'm developing. I created a Borlndmm.dll by compiling borlndmm.dpr with the following directives: FullDebugMode;ClearLogFileOnStartup;EnableMemoryLeakReporting;borlndmmdll;debugdll;NoMessageBoxes;UseOutputDebugString
When I use the borlndmm.dll no logfile is created. I traced the problem to the RequireIDEPresenceForLeakReporting directive which is set by the borlndmmdll directive. RequireIDEPresenceForLeakReporting causes DelphiIsRunning to be called, but this method does not work in a service (runs under SYSTEM account).
Is it possible to make it more robust or add an directive to indicate you want to use this dll for a service so there must be no check on IDE presence?
Hi,
Have you tried enabling all the individual options, except RequireIDEPresenceForLeakReporting? Take a look in FastMM4Options.inc in the section "Compilation Options For borlndmm.dll".
Pierre
I got it working that is not the problem. But when you add the borlndmmdll directive, RequireIDEPresenceForLeakReporting is automatically defined in a part of the code that has a big "Do not modify below this line" comment. Because I only used it for debugging I removed the RequireIDEPresenceForLeakReporting anyway and everything works now.
So RequireIDEPresenceForLeakReporting is silently added and then you are wondering why there is now memoryleak report. I figured it out eventually but it is taking a lot of time to do so.
So can you make DelphiIsRunning to work under a service or maybe add an directive ServiceDebugging that will undef RequireIDEPresenceForLeakReporting? Or just add a warning in the comments that RequireIDEPresenceForLeakReporting is not working for services.