Hi Everyone,
Hermano messaged me today about the memory issue that we have with ESME Desktop. There is bug logged about this on googlecode here
http://code.google.com/p/esmeproject/issues/detail?id=2
We got into a discussion about why it happens .. the discussion had some detail so I thought I'll post it here for everyone.
Thank you,
Mrinal
http://weblog.mrinalwadhwa.com
An extract from our IM conversation ...
Hermano: I was thinking about the memory issue on the esme desktop client.
Mrinal: yes ... the renderer has to be re written with very low level objects: bitmaps and textfields,
After that I plan to rewrite or at least fix flex frameworks mx:List component as I think it has bugs ... then we should be good
What were your thoughts?
Hermano: The renderer processes all messages every time, right?
Mrinal: no there is one renderer per message ... the memory problem happens because the size of each
renderer is big since it is based on Canvas, Label, Image etc which are heavy components
also, I am using a mx:Repeater right now .. which creates 40 renderers for 40 messages
... an mx:List recycles renderers so for 40 messages there are only say 5 renderers
.. that is good thing, but mx:List has bugs and they were giving me issues
Hermano: On the early versions right? I remember the esme code using mx:List
Mrinal: yes .. that is the best approach, but it was giving me problems and demojam was coming up
so I switched to using mx:Repeater
I think I put a comment in the code about this too
Hermano: But, in the place of mx:Image and the text fields, what could be placed?
Mrinal: well in place of mx:Image .. we could use the basic Bitmap class of the flash player
in place of mx:Text or mx:Label .. we could use the low level TextField class
the problem with going to that low level is that you loose the Flex Framework goodies like layout management etc
but our lists can have several items, plus we can have several lists so we need to optimize to the lowest level
Hermano: Understand... I tought the renderer where creating multiple instances of messages on the memory
Mrinal: Nope