Label object not garbage collectedhttps://www.eclipse.org/forums/index.php/mv/msg/173356/551668/#msg_551668
In my application i have to create large number of draw2d label objects. I am creating label objects and addding it on IFigure which is then displayed on canvas. I am creating and adding to IFigure object and when i do not require i am calling this to clear unwanted objects.

This clear required objects from my labelFigure. During analysis of memory using Yourkit profiler i observed that removed objects are not cleared and my application crashes due to out of memory as most of memory is used by label objects.

The created Label objects are not referenced by anyone except labelFigure.

If i do labelFigrue.clear and labelFigure = null then i can reclaim memory used by Label objects.
Is there any other way to reclaim memory used by Label objects othen than making labelFigure = null.

]]>Vijay Raj2010-08-09T07:18:29-00:00Re: Label object not garbage collectedhttps://www.eclipse.org/forums/index.php/mv/msg/173356/551686/#msg_551686
Thanks for reply.
In my application, i have to either create / call clear depending upon
some selection parameter. So for a certain selection parameter if i have extra labels in labelFigure then i do labelFigure.getChildren().subList(figureCount,
labelFigure.getChildren().size()).clear(); to remove extra labels present in labelFigure.