8 Replies Latest reply on Feb 8, 2010 10:15 PM by Flex harUI

    Arraycollection performance issue

    Subeesh Arakkan Level 4

      Hi All,

       

      I am working on trading application which displays stock quotes information. I use a TileList and set the dataprovider to an arrraycollection. When the  dataprovider is updated frequently ( around 20 times per sec ), the memory usage spikes up. If we run the application for around 1 hour,the app stops updating as all memory is used up.

       

      For testing, i removed the itemrenderer and still the memory usage spikes up. BTW, I use, BlazeDS to push quotes data to the Flex application.

       

      Any help would be greatly appreciated

       

      Subeesh

        • 1. Re: Arraycollection performance issue
          Flex harUI Adobe Employee

          Use the profiler to see where the memory is going.

          1 person found this helpful
          • 2. Re: Arraycollection performance issue
            Subeesh Arakkan Level 4

            Hi Alex,

             

            As suggested, I used profiler to check the issue. Number of cumulative instances of ListCollectionViewCursor increases during each push from the server. When the app runs for long, this number goes very high and the app crashes.

             

            Thanks

            Subeesh

            • 3. Re: Arraycollection performance issue
              asagohan

              Did you find an answer to the  ListCollectionViewCursor increases? I am having the same problem except it is occuring when I do PopUpManager.addPopUp(wizard, this, true);

               

              This popup can be opened and closed many times, however I only have one instance of wizard. After opening it and closing it a few times, the number of culmative ListCollectionViewCursor objects starts increasing very rapidly and it takes longer and longer to display the popup on the screen each time.

               

              So I might have 16 instances of ListCollectionViewCursor in memory before and after I open the popup but the number of culmative instances increases exponentially each time it is opened. I get increases of hundreds of thousands of ListCollectionViewCursor culmative instances as it opens the popup, but the number of actual instances is only 16 after it opens.

               

              It seems to have something to do with the comboboxes that are in my wizard (of which there are 4), but why are so many ListCollectionViewCursors being created? Also, just clicking on the combobox to bring up the drop down causes more ListCollectionViewCursors to be created.

              • 4. Re: Arraycollection performance issue
                Flex harUI Adobe Employee

                The profiler should be able to help you figure it out.

                • 5. Re: Arraycollection performance issue
                  asagohan Level 1

                  Yes, I used the profiler to get that far already. But I don't know how I can use it now to get any further. I can see what is happening but I have no idea why. Why do comboboxes make so many ListCollectionViewCursors? If I am popping up the same wizard multiple times why does it keep doubling the number of cumulative instances of ListCollectionViewCursors? All I know is that it has something to do with the comboboxes. They are defined in mxml in a viewstack on a panel.

                   

                  Even putting just a single combobox in an app with 3 items in the combobox creates 14 cumulative instances of ListCollectionViewCursors on startup. Why?

                  • 6. Re: Arraycollection performance issue
                    Flex harUI Adobe Employee

                    The cumulative is not nearly as important as the active total.  Also the

                    live-objects panel will show false positives for activationobjects used in

                    try/catch blocks.

                    • 7. Re: Arraycollection performance issue
                      asagohan Level 1

                      Yes, but my problem is that as the popup window opens, thousands of instances of ListViewCollectionCursor are created and then destroyed, so I only can see it in the cumulative instances column because they dissapear too fast. But they are definately getting created because each time I open the popup, it takes longer and longer to display on the screen until it starts taking minutes to display the popup. And each time almost double the amount of ListViewCollectionCursors are created as the previous time I opened the popup. If I remove my 4 combo boxes from the popup, I do not have this problem. There is no try/catch blocks in that area of code.

                       

                      So I am still wondering why comboboxes create so many ListViewCollectionCursors....

                      And why would it keep doubling the amount of ListViewCollectionCursors for a very breif period each time I open a popup that contains combo boxes?

                      • 8. Re: Arraycollection performance issue
                        Flex harUI Adobe Employee

                        You might be seeing a false-positive.  When I run my test, only 4 are

                        created, two because the component starts off with a default empty

                        collection and two others when the collection is finally assigned.  The

                        other instances are probably activationobjects.  If you are seeing 1000's of

                        those, it implies you are simply not using collections efficiently.  If you

                        have a lot of data, you should not append them one-by-one to an empty

                        collection, you should batch them up and reassign a new collection.