Memory leak in 11.7

Posted by jquerijero on 21-Jun-2018 13:27

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? 

All Replies

Posted by Laura Stern on 21-Jun-2018 15:15

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.

Posted by jquerijero on 21-Jun-2018 15:33

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.

Posted by Laura Stern on 22-Jun-2018 06:42

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.  


Laura

Sent from my iPad

Posted by James Palmer on 22-Jun-2018 06:59

Erroneous post.

Posted by Roger Blanchard on 22-Jun-2018 07:08

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.

Posted by jquerijero on 22-Jun-2018 12:34

[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.

[/quote]

I tried your suggestion, but it is giving "Invalid or inappropriate handle . . . (5425)" error.

Posted by jquerijero on 22-Jun-2018 12:42

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.

This thread is closed