tags:

views:

646

answers:

1

Profiling my app I observe a fair amount of ChildConstraintInfo objects that consume almost 10% of app memory.

I'd like to understand where these objects come from. Couldn't find anything in Flex help. My assumption is they are created with each V/HBox or Canvas.

Any info is appreciated that would also help me understand how to minimize the amount of these objects.

A: 

My vote is that it's the constraint information of all the child components when using left, right, top, bottom positioning. (vertical center and horizontal center as well). You might be getting these high numbers if you are using a lot of nested VBox(s) and HBox(s). When ever possible you should limit these components because they take up a lot of memory to calculate their positions.

Shua
I ran a little test app and saw that each first-level UI component inside a canvas adds one ChildConstraintInfo object. But having nested V/HBoxes doesn't seem to create any at all.
Stefan
It furthermore appears that ChildConstraintInfo (CCI) objects are not necessarily meant to be persistent. In my real app I have a canvas with 80 images but when I open the corresponding view only 4 or 5 CCI objects are added. However I can see in the cumulative instances that hundreds of objects were created while the layout was happening. This leaves me with 2 additional questions: a) do CCI objects leak? b) Contrary to your answer it seems that having nested boxes is less expensive in terms of CCI-s. Can this be confirmed?
Stefan
(I mean less expensive than putting UI components on a canvas)
Stefan