3 Replies Latest reply on Nov 10, 2009 2:35 PM by Flex harUI

    Spurious cumulative instances in FB3 profiler?

    RyanORo Level 1

      I'm seeing something strange in the FB3 profiler, wondering if this is a known issue, or how to interpret it.

       

      For one of my classes, I see the "cumulative instances" count constantly increasing - dozens per second.  I do not believe I am actually allocating any instances of this class when the count is going up.  In fact it is a singleton.  Furthermore, the (active) "instances" count remains at 1, and both the "cumulative memory" and the "memory" columns do not show any changes.

       

      The fact that "cumulative memory" doesn't change really makes it seems like the profiler is showing something spurious, as how could there be increasing numbers of "cumulative instances" without any memory allocations?

       

      I am trying to track down an intermittent memory leak which might involve this class, so there may be something going on, but so far I cannot find any legitimate back references when the memory leak does occur.  Are these apparently bogus cumulative instances some kind of clue?

        • 1. Re: Spurious cumulative instances in FB3 profiler?
          Flex harUI Adobe Employee

          If you have try/catch blocks or anonymous functions in that class you might see something like this as you code accesses that class.  The profiler just reports the AS object that was at the top of the call stack at the time something is allocated.

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          1 person found this helpful
          • 2. Re: Spurious cumulative instances in FB3 profiler?
            RyanORo Level 1

            Thanks, that could indeed be going on...

             

            The next thing I'm wondering is, if one of those objects being allocated in an anonymous function ends up leaking, will it show up in the profiler, or is that outer class "hiding" it?

             

            Or is it the anonymous function itself being allocated here that shows up as an instance of the outer class?

            • 3. Re: Spurious cumulative instances in FB3 profiler?
              Flex harUI Adobe Employee

              It will show up in the profiler.  If you take memory snapshots over time and look at the instance counts and they are the same, then that is not the cause of the leak.  When you allocate a class instance or even an Object in an anonymous function, it will show up in the profiler as that class instance or under Object.  The false positives in cumulative instances might be the stack/scope chain that is saved in association with that instance of the function, and there should be an increase of 1 under Function until that function goes away.

               

              Alex Harui

              Flex SDK Developer

              Adobe Systems Inc.

              Blog: http://blogs.adobe.com/aharui