Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Label object not garbage collected(Label object not garbage collected)
Label object not garbage collected [message #551668] Mon, 09 August 2010 01:51 Go to next message
vikas  is currently offline vikas
Messages: 10
Registered: July 2009
Junior Member
Hi
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.

labelFigure.getChildren().subList(figureCount,
labelFigure.getChildren().size()).clear();

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.

Thanks,
Vikas
Re: Label object not garbage collected [message #551684 is a reply to message #551668] Mon, 09 August 2010 03:18 Go to previous messageGo to next message
Vijay Raj
Messages: 608
Registered: July 2009
Senior Member
What do you mean by....
Quote:
I am creating and adding to IFigure object and when i do not require i am calling this to clear unwanted objects.

labelFigure.getChildren().subList(figureCount,
labelFigure.getChildren().size()).clear();




when is this???
after closing the canvas...
or after rendering.....



---------------------
why, mr. Anderson, why, why do you persist?
Because I Choose To.
Regards,
Vijay
Re: Label object not garbage collected [message #551686 is a reply to message #551684] Mon, 09 August 2010 03:36 Go to previous message
vikas  is currently offline vikas
Messages: 10
Registered: July 2009
Junior Member
Hi Vijay,
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.

Thanks,
Vikas

Previous Topic:Alligning the child figures
Next Topic:GEF install on clean Helios Win64 not functioning
Goto Forum:
  


Current Time: Fri Jul 25 02:58:29 EDT 2014

Powered by FUDForum. Page generated in 0.02776 seconds