therabbitwindfall / flash-console

Automatically exported from code.google.com/p/flash-console
0 stars 0 forks source link

Memory leak #89

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create an empty project.
2. Start Cc
3. Open Memory graph

What is the expected output?
Memory consumption is not increasing.

What do you see instead?
Memory consumption is increasing continuously.

What version of the product are you using? On what operating system?
2.52, FP 10.2 Debug

Original issue reported on code.google.com by dmitry....@gmail.com on 15 Aug 2011 at 12:13

GoogleCodeExporter commented 8 years ago

Original comment by luay...@gmail.com on 15 Aug 2011 at 10:34

GoogleCodeExporter commented 8 years ago
I've been trying various combinations to try find where the leak is.
When you first launch Memory monitor, it will use more memory to produce the 
graph history data. History data is kept just enough to be able to draw graph's 
width (older ones are discarded). 
So in theory, once the graph line fills up the panel, we should see a flat line 
on memory monitor.

This is not what's happening so first I thought it is memory leak. 
Pressing G also don't bring it back down.
I tried a number of tests, tried a lot using flash builder's profiler, etc. 
The only thing that seem to 'hang around' are Strings.

So as my final attempt, I left console running for 2 hours with just memory 
monitor on (using SampleAdvanced.swf). When I get back, memory graph says min 
5.86mb, max 8.48mb, current 6.12mb. So it looks like it eventually get garbage 
collected.

Possibly just the way flash GC works. It could also be due to the use of 
graphic.clear() graphic.lineTo(), etc - maybe it got its own GC rules.

Original comment by luay...@gmail.com on 4 Sep 2011 at 11:42

GoogleCodeExporter commented 8 years ago
Thank you for your investigation, I'll to dig deeper and will post the results 
soon.

Original comment by dmitry....@gmail.com on 5 Sep 2011 at 7:47

GoogleCodeExporter commented 8 years ago
So, I testes it a bit more and figured out this things:

1. Something is trashing the memory in the graph code - if I open Memory or FPS 
monitors - memory starting to grow, but as you correctly noticed - it will be 
collected and will not leak generally, but every time it collected by GC some 
fps drop could appear especially on mobile devices.

2. Nothing is not trashing memory if graph are closed.

3. Both Hi-Res and FlashPreloadProfiler memory\fps graphs has no such issue - 
memory is not growing and not GC-collected while this tools work and show us 
their graphs.

Original comment by dmitry....@gmail.com on 5 Sep 2011 at 8:45

GoogleCodeExporter commented 8 years ago
I think I've finally found the cause of this, and there isn't anything I can do 
about it as it is the nature of Flash.
See http://junkbyte.com/wp/as3/flash-string-weirdness/

I will try to reduce the need to stack strings together in the hope that it'll 
abolish this leak. But I am changing the status to 'WontFix' as I can't promise 
it will improve.

Original comment by luay...@gmail.com on 19 Feb 2012 at 7:31