Skip navigation
DonMoir
Currently Being Moderated

Extreme memory usage per character in FTE

Nov 11, 2009 12:04 PM

I ran a few test to check memory issues. If I populate a TextElement with 100,000 characters and then do just one createTextLine I see the memory usage jump about 18 megabytes. So I create one textline, do not add it to the display list, and I see the memory increase. If I don't call createTextLine (but do everything else), then I do not see the radical increase in memory usage. I paired this down to 50,000 characters and to me it looks like somewhere on the order of 150-200 bytes is being used for the storage of each character. Just a guess but can someone shed some light on this.

 

Seems to be a direct correspondence between number of characters and the extreme use of memory for each character, so that is how I arrive at the approximate 150-200 bytes per character.

 

Since this has nothing to do with reusing textLines etc... Is this kind of issue resolved in 10.1 ?

 

Don

 
Replies
  • Currently Being Moderated
    Nov 11, 2009 5:49 PM   in reply to DonMoir

    Various FTE data structures were improved in 10.1 to reduce the per-character storage. It should be on the order of 2-10 bytes per character, I think.

     

    Gordon Smith

    Adobe Flex SDK Team

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 12, 2009 1:23 PM   in reply to GordonSmith

    An engineer who worked on these 10.1 improvements gave me sone additional information that is worth sharing:

     

    2-10 bytes per character is the permanent data structure that's needed to render lines. We still consume 30-120 bytes of temporary data during the creation of this structure (30 in the common case, 120 in other cases with non-default styling or circumstances). Numbers are approximative.

     

    Gordon Smith

    Adobe Flex SDK Team

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 12, 2009 6:06 PM   in reply to DonMoir

    Since TextLines are created one-by-one, I believe Player 10.1 needs to use 30-120 bytes of temporary memory per character in that line. So if there are 100 characters in the line, that would be 3-12K of temporary memory. Once the TextLine is created, that memory can be released. Then the next TextLine needs 3-12K of temporary memory. I'll check this with the Player engineer and get back if this is incorrect.

     

    Gordon Smith

    Adobe Flex SDK Team

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 16, 2009 4:59 PM   in reply to GordonSmith

    There are two data structures that contribute to the memory picture.

     

    One is a "temporary" data structure that is used for the creation of the TextLines of a TextBlock. This data structure has ~one entry for each character in the TextBlock. In 10.0, the per entry cost is more or less what you have measured (150 bytes). In 10.1, we have arranged to make that structure ~30 bytes for many common cases, but it remains ~100+ bytes in others.

     

    The other is the data structure that describes the content of a TextLine.  In 10.1, that data structure contains all the data necessary to display the line, determine atom boundaries, etc It is ~ 2-10 bytes/character, with 2 being a common case for English text, no kerning.

     

    In 10.1, we also added a method on TextBlock that lets you release the "temporary" data structure. It will be recreated when needed (e.g. you change the content of the TextBlock and/or you create new lines from it).

     

     

     



     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points