| 45 | and as you scroll down you'll see all the objects in the GC heap. |
| 46 | |
| 47 | == Using the GC Heap Inspector page == |
| 48 | |
| 49 | The page currently has four main sections. |
| 50 | |
| 51 | The first is '''Paths to roots''' (probably a bad name that needs fixing). Arbitrarily, I've decided that interesting objects are '''Windows''' and '''HTMLDocuments''', because if you leak these, you tend to leak lots of other data. A ''path'' here is a chain of references from some root object to the object of interest. Often, there can be multiple such paths, so the UI shows the shortest one. |
| 52 | |
| 53 | The second section is '''All paths to…''' and this fills in when you click the "Show all paths" button for an object. |
| 54 | |
| 55 | The third section is '''Roots'''. This lists all objects that are GC roots, and if you expand a category, you'll see that it lists why something is considered a root. For example: |
| 56 | {{{ |
| 57 | HTMLCollection cell 0x116c9b840 wrapped 0x1161311f0 “url http://localhost:8800/IndexedDB/value.htm” (GC root—Weak sets, Reachable from HTMLCollection ownerNode) |
| 58 | }}} |
| 59 | |
| 60 | Let's break this down. |
| 61 | * {{{HTMLCollection}}}: the C++ type of the object (exposed to JS as a JSHTMLCollection object). |
| 62 | * {{{cell 0x116c9b840}}}: the address of the JSCell representing this object |
| 63 | * {{{wrapped 0x1161311f0}}}: this address of the "wrapped" object, i.e. the underlying HTMLCollection object. |
| 64 | * {{{“url http://localhost:8800/IndexedDB/value.htm”}}} this shows the URL of the document that the wrapper belongs to. |
| 65 | * {{{(GC root—Weak sets, Reachable from HTMLCollection ownerNode)}}}: this tells us why this object is considered a GC root; in this case, the ownerNode of the HTMLCollection is still alive and references this HTMLCollection. |
| 66 | |
| 67 | Finally there is the '''All Objects by Type''' section, that lists all the objects in the GC heap (thousands of them). Many of these are built-in objects and functions and not very interesting. |