Skip to main content
October 4, 2013
Question

Memory leak check question

  • October 4, 2013
  • 1 reply
  • 549 views

I have some horrendous memory leaks to attack.

Is this the correct way to monitor your mem...?

private var checkMemoryIntervalID:uint = setInterval(performMemTest,1000);

function performMemTest():void {

       

            trace(System.totalMemory);

            System.gc();

            System.gc();       

        }

I've traced the first leak to a function - if I don't make the function call, my mem stays the same no matter how many times I repeat whatever steps I take to get to that function.

So I thought I'd empty the function, and add the lines back in one by one to see where the leak is.

However, even with the function completely empty, mem still increases. Comment out the call to the function and mem stays where it should.

The function contructor is just...

private function populateData ():void

So I figure I am monitoring mem incorrectly, because the above line itself shouldn't be a mem leak, right?

Cheers for taking a look.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 4, 2013

if you're calling that function with an event (either directly or indirectly), the problem may not be in that function but in some other listener function.

October 4, 2013

Gidday kglad

It's called from...

case "undone":
populateData();
break;

There's no leak if I comment out populateData(), but there is if not.