Has anyone experience memory leak in 11.7 by just opening and closing ABL forms? After closing all open windows except the main form, memory usage of our application running on 11.7 is not going down after an hour. Our 11.6 instance of the same application, which I'm running in parallel, is behaving as expected.
Any thoughts?
Try using DELETE OBJECT on the form. In general, garbage collection should take care of things. But forms in particular tend to have circular references so we recommend explicitly deleting them. See if that helps.
Can you suggest a pattern for modeless windows on when to call DELETE OBJECT explicitly? BTW, I'm comparing the same code, one compiled and running on 11.6 and another on 11.7, so I'm wondering if there is feature set that was introduced in 11.7 that could be causing the leak.
The short answer is No to your first question. Often this occurs when using Infragistics controls. Sometimes it has to do with event subscriptions. I don’t think there should be a difference between 11.6 and 11.7min this respect. But maybe I don’t remember. I can only suggest trying this to see if it fixes the problem.
Erroneous post.
What we do is subscribe the form to a Form_Close event in our MainMenu;
oForm:FormClosed:SUBSCRIBE (THIS-OBJECT:Form_Closed).
Then when the form closes we delete the object in that event as well as other clean up for different type of forms
METHOD PRIVATE VOID Form_Closed(sender AS System.Object, e AS System.EventArgs):
DELETE OBJECT sender NO-ERROR. /* this will delete form */
END.
[quote user="Roger Blanchard"]
What we do is subscribe the form to a Form_Close event in our MainMenu;
oForm:FormClosed:SUBSCRIBE (THIS-OBJECT:Form_Closed).
Then when the form closes we delete the object in that event as well as other clean up for different type of forms
METHOD PRIVATE VOID Form_Closed(sender AS System.Object, e AS System.EventArgs):
DELETE OBJECT sender NO-ERROR. /* this will delete form */
END.
I tried your suggestion, but it is giving "Invalid or inappropriate handle . . . (5425)" error.
It's also giving me the same invalid handle error (5425) for some reason when I add DELETE OBJECT <myForm>. I don't think it should matter, but I'm closing the window using the red X.