GC

GregTomkins

Active Member
2 questions in 2 days ... this can't be good.

Can one of you 11.x gurus fill me in on the state of Garbage Collection?

The 10.2 doc suggests that GC exists for ".NET and ABL objects" (if it does, we don't use it).

#1 - does it apply to 'older' constructs such as CREATE TEMP-TABLE (as opposed to CLASS)? In other words, is DELETE OBJECT basically obsolete?

#2 - why is there still a WIDGET-POOL clause in the CLASS definition syntax? In my mind, WIDGET-POOL is a workaround for lack of GC in prior versions. Maybe it still is?

Any insights appreciated, cheers.
 

Cringer

ProgressTalk.com Moderator
Staff member
AFAIK the GC is only for the new style objects. There's been a bit of a discussion about it on one of my threads IIRC. I'll try and dig it out.
 

tamhas

ProgressTalk.com Sponsor
It applies only to ABL objects (.NET has its own GC) and it is there and working whether you think you use it or not, i.e., there is nothing to turn on. It has some known limitations, notably circular references.
 

RealHeavyDude

Well-Known Member
Any handle-based object that your instantiate with the CREATE statement is not covered by the garbage collector. You need to manage their life cycle yourself either by using widget pools or delete them with the DELETE OBJECT statement. Bottom line, you create it, you delete it - as it has always been ...

Any ABL object that your NEW will be covered by the garbage collector. It will be garbage collected as soon as the AVM does not have any valid reference any more ( very similar behavior to Java - don't know .NET well enought to say the same thing about it ). In contrast to technologies like Java where you can't delete and object - just invoke the garbage collector - in the ABL you can deliberately delete an ojbect before it is garbage collected. I see that as a big plus as the Java garbage collector has caused my headaches over and over again.

Heavy Regards, RealHeavyDude.
 
Top