Skip to main content
Inspiring
March 21, 2012
Answered

Memory Leak when just launched and Idle.. fixes when being used ?? [HELP]

  • March 21, 2012
  • 3 replies
  • 1352 views

So I'm in the debugging and testing phase of my app and using this tool for tracking memory leaks ( https://github.com/mrdoob/Hi-ReS-Stats )

When I launch my app my numbers are

FPS: 61/60

MS: 17

MEM: 3.157

MAX: 3.157

Now immediately my memory starts increasing    from  3.157, 3.167, 3.177, 3.187, 3.197 and so on.

Now if I make any nav selection in my app

MEM changes back down to about 3.215

but then it starts its count again   3.215, 3.225,  3.235, 3.445, 3.455

I don't have any loops happening.

Has anyone run in to this ?

I'm almost tempted to force garbage collection every 60 seconds that the app is idle or something.  Not the best way to handle this ..   I just dont know where the leak is happening.

Any support is appreciated!

Cheers!

This topic has been closed for replies.
Correct answer Applauz78

Oh man! ..   So I created a new stage and only put the profiler on the stage ... and it's the same thing.  ...    So I think it's the profiler itself that is causing the memory to keep increasing.

So then ....    How can I truly test my app for memory leaks, etc. ?

3 replies

Inspiring
March 22, 2012

Hi there - I just had the same query a couple of days ago (http://forums.adobe.com/thread/977174?tstart=30).

I saw the same symptoms on my app so I built a blank app with just the profiler on stage. I've been monitoring it for a few days now and notice that memory does creep up even when the app is left idle (apart from the profiler) - but ... and this is the important bit ... it does periodically get reduced back to the starting point (when the garbage collector kicks in and memory is released).

When I was monitoring my app the time through this cycle could be well over 5 mins.

If you actually use the monitor when putting your app through it's paces you'll see memory being gobbled up more rapidly and hopefully (if you've no leaks) the garbage collection kicking in more regularly and bringing the reported usage back down.

Applauz78AuthorCorrect answer
Inspiring
March 21, 2012

Oh man! ..   So I created a new stage and only put the profiler on the stage ... and it's the same thing.  ...    So I think it's the profiler itself that is causing the memory to keep increasing.

So then ....    How can I truly test my app for memory leaks, etc. ?

Inspiring
March 21, 2012

Well you saw the memory go back down to normal right?  That means it's not a memory leak.  All apps will allocate/deallocate memory as the app runs.  It's only a memory leak if memory isn't being released.  There are several tools that have memory profilers (Flash Builder, FDT, FlashDevelop) to help you track down memory leaks.  I don't think you can profile on the device, but you can profile on your desktop first to get rid of any memory problems before deploying to the device.