Forum Post: AW: Garbage collection - How Can I know the number of references to an object?

  • Thread starter Thread starter Mike Fechner
  • Start date Start date
Status
Not open for further replies.
M

Mike Fechner

Guest
That bit of sample code you provided loops through all objects and checks for a common criteria. How many objects are you looping through? 1000’s or 100.000’s? How difficult is it to compute the result of the ToString() method (assuming you have overridden it). Just looking though all objects is typically not that expensive. Which runtimes do you experience? But that would not be a solution to your initial enquiry about the number of objects referencing another object. Von: ecsousa [mailto:bounce-ecsousa@community.progress.com] Gesendet: Donnerstag, 11. September 2014 23:29 An: TU.OE.General@community.progress.com Betreff: RE: [Technical Users - OE General] Garbage collection - How Can I know the number of references to an object? RE: Garbage collection - How Can I know the number of references to an object? Reply by ecsousa First, sorry about my english mistakes...i don´t know how to write in english very well... I need to make a function like a Handle function.....for objects of a particular class ... example: def var x as handle no-undo. def var y as handle no-undo. def var str as char no-undo. str = string(x). y = handle(str). So.. i have my class ellen... def var x as ellen no-undo. def var y as ellen no-undo. def var str as char no-undo. str = x:tostring(). How can I get the object from str?? I made the next code....but it is very expansive ( time) when i have many objects. Define Variable myObject As Char no-undo. define variable loop as Progress.Lang.Object no-undo. Assign myObject = "1234". loop = Session:First-object. Do While valid-object(loop) : if (loop:tostring() = myObject) then Do: MESSAGE "Found!!!" VIEW-AS ALERT-BOX INFO BUTTONS OK. Leave. End. loop = loop:Next-sibling. End. As alternative solution......I am saving the objects in a temp table.. but the garbage colletion never deletes my object because they have an reference in my temp-table.......... and I dont have when i should delete the record..... :/ Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Back
Top