Skip to main content


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 05:51 Go to next message
vikas  is currently offline vikas Friend
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 07:18 Go to previous messageGo to next message
Vijay RajFriend
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 07:36 Go to previous message
vikas  is currently offline vikas Friend
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 Mar 29 13:42:59 GMT 2024

Powered by FUDForum. Page generated in 0.03412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top