Hi Everybody,

I have identified the memory consumption problem within the custom 
ItemRenderer. This IR is derived  from UIComponent and besides other 
elements has 3 Image members to display 3 possible icons.
The grid has around 200 elements, so 200 IRs are created at the 
startup. Each IR creates 3 Images in createChildren() method with 
source = null. Source is set in the commitProperties() method, when we 
know the data. In reality only 10-15 IRs are displaying icons, the 
rest are just waisting the space (600 instances of Image consumes 
aroung 700Kb according to Profiler).

My question is how can I improve the efficiency of this IR? 

Is this possible to create Image instances on demand, not in the 
createChildren() method? 

I tried to create and destroy Images in commitProperties() according 
to data, but then I bumped into the problem that updateDisplayList() 
for the IR could be called with inconsistent data. I.e. data says that 
we need icons, but the the Image objects is null, they have not been 
created yet by commitProperties()/set data() for this instance.
Is this a recycling feature that the order of 
commitProperties()/updateDIsplayList() are not guaranteed? Or I have 
overseen something?


Thanks in advance!

Regards,
Dmitri.





Reply via email to