Hi everyone
I'm trying to chase down a memory leak in our application (PB 2022 1900) that appears to happen when a window is repeatedly opened and closed. (Symptoms: When I open a window inheriting from our base window class, used memory increases by X, when I close the window, it only decreases by Y (which is less than X). When I open a window inheriting from a base window, this problem doesn't occur, so it must be something in our code)
What I've tried so far:
- Look for suspect code in our base window class. -> Haven't found anything obvious, but that code definitely deserves to be considered guilty until proven innocent ;-)
- Check the debugger tab "Objects in memory" before and after repeatedly opening and closing the window. -> No difference found
- Start a profiler trace on the activities "ActObjectCreate!" and "ActObjectDestroy!" and check the "Profiling class view" for classes showing more creates than destroys. -> Even after opening and closing the window a dozen times, I haven't found any class with more than 1 "create surplus". Conversely I've found several classes with quite a few more destroys than creates.
- This has led me to believe that the problem might lie in some objects getting duplicated when passed as arguments (which I assume wouldn't call the constructor for the copied object but both copies could get destroyed seperately later)
Does anyone have any good ideas on how I else I could track down objects that aren't getting properly cleaned up when the windows are closed.
Or (if my suspicion about objects possibly getting duplicated somehow is reasonable) how to find out where that happens.
Regards,
Markus