Note that there are some explanatory texts on larger screens.

plurals
  1. POFB Profile says "it is a gc root", but it seems wrong?
    primarykey
    data
    text
    <p>People like flash builder profile tool very much.But recently, a problem came to me when I tried to find a memory leak. Here is the simplified sample.</p> <pre><code>package { import flash.display.Sprite; import flash.sampler.pauseSampling; import flash.system.System; import org.robotlegs.base.ContextBase; import org.robotlegs.mvcs.Context; public class MemoryLeak extends Sprite { public function MemoryLeak() { makeAndDrop(); } public function makeAndDrop():void{ var _context : Context = new Context(this); _context = null; } } } </code></pre> <p>This is a simple class that create an object and then release it. When I use the profile perspective, it show me "live objects". <img src="https://i.stack.imgur.com/MCrvG.png" alt="enter image description here"> This is expected since I know that GC will free an object only when it doesn't have enough memory. Then I take a snapshot, to see the weird thing: Before I expand the path, it is like this: <img src="https://i.stack.imgur.com/4KRVO.png" alt="enter image description here"> And I am interested in the holder of context object, so I expand it: <img src="https://i.stack.imgur.com/gRraq.png" alt="enter image description here"> That's so strange! As you see, nothing holds a reference to it.And it is implied to be a "GCRoot". I know articles about gc root, and it's quite simple(I read up to 20 articles about GC strategy to ensure my comprehension).It is no possible that the context is a gc root. And what's more, this isn't "1 path" at all! I hope it's a bug of profile tool, but I do want some explanations. So please forget about the "why not collect issue". I hope somebody tell me why the profile tool say"context is an gc root".Is it a bug or something? PS: I use flash builder 4.6 and flash debugger 11 sa.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload