| Label object not garbage collected [message #551668] |
Mon, 09 August 2010 01:51  |
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   |
Vijay Raj Messages: 604 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  |
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
|
|
|
Powered by
FUDForum. Page generated in 0.01741 seconds