Reasons for the memory problems in ESME Desktop

1 view
Skip to first unread message

Mrinal Wadhwa

unread,
Sep 25, 2008, 11:17:32 PM9/25/08
to esme...@googlegroups.com
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

Dennis Howlett

unread,
Sep 25, 2008, 11:24:11 PM9/25/08
to esme...@googlegroups.com
Is it worth pinging Dan McWeeney/Matt Zeller direct on this to see if your thinking is in the right ballpark or if there is another solution that doesn't cause the Flex issue you mention at the end?

D -:)
--
This message is: private and confidential [ ] bloggable with prior permisssion [ ] bloggable without permission [ ]
Dennis Howlett
t: +34 953 708 636 (int'll)
m: +34 607 482 739 (int'l)
skype: dahowlett

Mrinal Wadhwa

unread,
Sep 25, 2008, 11:29:21 PM9/25/08
to esme...@googlegroups.com
Well I'm pretty confident what the problem is and also know the solution .. just need to find some time to fix
But its ok if you want to run it by Dan or Matt.
_
Mrinal 

Dennis Howlett

unread,
Sep 26, 2008, 12:11:44 AM9/26/08
to esme...@googlegroups.com
I knew I should keep out of your turf ;(

D -:)

Mrinal Wadhwa

unread,
Sep 26, 2008, 12:14:24 AM9/26/08
to esme...@googlegroups.com
LOL :) .. nah you're most welcome.

Mrinal
Reply all
Reply to author
Forward
0 new messages