| OLD | NEW |
| (Empty) | |
| 1 <link rel="import" href="../../../../packages/polymer/polymer.html"> |
| 2 <link rel="import" href="class_ref.html"> |
| 3 <link rel="import" href="observatory_element.html"> |
| 4 <link rel="import" href="nav_bar.html"> |
| 5 <link rel="import" href="view_footer.html"> |
| 6 |
| 7 <polymer-element name="heap-snapshot" extends="observatory-element"> |
| 8 <template> |
| 9 <link rel="stylesheet" href="css/shared.css"> |
| 10 <nav-bar> |
| 11 <top-nav-menu></top-nav-menu> |
| 12 <vm-nav-menu vm="{{ isolate.vm }}"></vm-nav-menu> |
| 13 <isolate-nav-menu isolate="{{ isolate }}"></isolate-nav-menu> |
| 14 <nav-menu link="{{ makeLink('/heap-snapshot', isolate) }}" anchor="heap snap
shot" last="{{ true }}"></nav-menu> |
| 15 <nav-refresh callback="{{ refresh }}"></nav-refresh> |
| 16 </nav-bar> |
| 17 <style> |
| 18 /* general */ |
| 19 .well { |
| 20 background-color: #ECECEC; |
| 21 padding: 0.2em; |
| 22 } |
| 23 .center { |
| 24 align-items: center; |
| 25 justify-content: center; |
| 26 } |
| 27 |
| 28 /* status messages */ |
| 29 .statusMessage { |
| 30 font-size: 150%; |
| 31 font-weight: bold; |
| 32 } |
| 33 .statusBox { |
| 34 height: 100%; |
| 35 padding: 1em; |
| 36 } |
| 37 |
| 38 /* tables */ |
| 39 .table { |
| 40 border-collapse: collapse!important; |
| 41 table-layout: fixed; |
| 42 height: 100%; |
| 43 } |
| 44 .th, .td { |
| 45 padding: 8px; |
| 46 vertical-align: top; |
| 47 } |
| 48 .table thead > tr > th { |
| 49 vertical-align: bottom; |
| 50 text-align: left; |
| 51 border-bottom:2px solid #ddd; |
| 52 } |
| 53 .spacer { |
| 54 width: 16px; |
| 55 } |
| 56 .left-border-spacer { |
| 57 width: 16px; |
| 58 border-left: 1px solid; |
| 59 } |
| 60 .clickable { |
| 61 color: #0489c3; |
| 62 text-decoration: none; |
| 63 cursor: pointer; |
| 64 min-width: 8em; |
| 65 } |
| 66 .clickable:hover { |
| 67 text-decoration: underline; |
| 68 cursor: pointer; |
| 69 } |
| 70 tr:hover:not(.focused) > td { |
| 71 background-color: #FAFAFA; |
| 72 } |
| 73 .focused { |
| 74 background-color: #F4C7C3; |
| 75 } |
| 76 .scroll { |
| 77 overflow: scroll; |
| 78 } |
| 79 .outlined { |
| 80 -webkit-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 81 -moz-box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 82 box-shadow: 0px 0px 2px 1px rgba(0,0,0,0.75); |
| 83 margin: 4px; |
| 84 } |
| 85 .centered { |
| 86 margin-left: auto; |
| 87 margin-right: auto; |
| 88 justify-content: center; |
| 89 } |
| 90 .full-height { |
| 91 height: 100%; |
| 92 } |
| 93 .mostly-full-height { |
| 94 height: 80%; |
| 95 } |
| 96 .full-width { |
| 97 width: 100%; |
| 98 } |
| 99 .focused-function-label { |
| 100 flex: 0 1 auto; |
| 101 margin-left: auto; |
| 102 margin-right: auto; |
| 103 justify-content: center; |
| 104 } |
| 105 .call-table { |
| 106 flex: 1 1 auto; |
| 107 } |
| 108 |
| 109 .tree { |
| 110 border-spacing: 0px; |
| 111 width: 100%; |
| 112 margin-bottom: 20px |
| 113 vertical-align: middle; |
| 114 } |
| 115 |
| 116 .tree tbody tr { |
| 117 animation: fadeIn 0.5s; |
| 118 -moz-animation: fadeIn 0.5s; |
| 119 -webkit-animation: fadeIn 0.5s; |
| 120 } |
| 121 |
| 122 .tree tbody tr:hover { |
| 123 background-color: #FAFAFA; |
| 124 } |
| 125 |
| 126 .tree tr td:first-child, |
| 127 .tree tr th:first-child { |
| 128 width: 100%; |
| 129 } |
| 130 |
| 131 .tree thead > tr > th { |
| 132 padding: 8px; |
| 133 vertical-align: bottom; |
| 134 text-align: left; |
| 135 border-bottom: 1px solid #ddd; |
| 136 } |
| 137 </style> |
| 138 <div class="content-centered-big"> |
| 139 <h1>Heap Snapshot (Experimental)</h1> |
| 140 <hr> |
| 141 <template if="{{ state != 'Loaded' }}"> |
| 142 <div class="statusBox shadow center"> |
| 143 <div class="statusMessage">{{state}}</div> |
| 144 </div> |
| 145 </template> |
| 146 <template if="{{ state == 'Loaded' }}"> |
| 147 <div class="memberList"> |
| 148 <div class="memberItem"> |
| 149 <div class="memberName">Refreshed at </div> |
| 150 <div class="memberValue">{{ snapshot.timeStamp }}</div> |
| 151 </div> |
| 152 <div class="memberItem"> |
| 153 <div class="memberName">Objects </div> |
| 154 <div class="memberValue">{{ snapshot.graph.vertexCount }}</div> |
| 155 </div> |
| 156 <div class="memberItem"> |
| 157 <div class="memberName">References </div> |
| 158 <div class="memberValue">{{ snapshot.graph.edgeCount }}</div> |
| 159 </div> |
| 160 <div class="memberItem"> |
| 161 <div class="memberName">Size </div> |
| 162 <div class="memberValue">{{ snapshot.graph.size | formatSize }}</div> |
| 163 </div> |
| 164 <div class="memberItem"> |
| 165 <div class="memberName">Analysis </div> |
| 166 <div class="memberValue"> |
| 167 <select value="{{analysisSelector}}"> |
| 168 <option value="DominatorTree">Dominator tree</option> |
| 169 <option value="MergeByClass">Group by class</option> |
| 170 </select> |
| 171 </div> |
| 172 </div> |
| 173 </div> |
| 174 <template if="{{analysisSelector == 'DominatorTree'}}"><p>In a heap domina
tor tree, an object X is a parent of object Y if every path from the root to Y g
oes through X. This allows you to find "choke points" that are holding onto a lo
t memory. If an object becomes garbage, all its children in the dominator tree b
ecome garbage as well. The retained size of an object is the sum of the retained
sizes of its children in the dominator tree plus its own shallow size, and is t
he amount of memory that would be freed if the object became garbage.</p></templ
ate> |
| 175 </template> |
| 176 </div> |
| 177 <br> |
| 178 <div class="content-centered-big"> |
| 179 <div class="tableWell shadow"> |
| 180 <table class="full-width tree"> |
| 181 <thead id="treeHeader"> |
| 182 <tr> |
| 183 <th> |
| 184 <template if="{{analysisSelector == 'DominatorTree'}}">Object</templ
ate> |
| 185 <template if="{{analysisSelector == 'MergeByClass'}}">Class</templat
e> |
| 186 </th> |
| 187 <th style="white-space: nowrap"> |
| 188 <template if="{{analysisSelector == 'DominatorTree'}}">Retained Size
</template> |
| 189 <template if="{{analysisSelector == 'MergeByClass'}}">Shallow Size</
template> |
| 190 </th> |
| 191 </tr> |
| 192 </thead> |
| 193 <tbody id="treeBody"></tbody> |
| 194 </table> |
| 195 </div> |
| 196 </div> |
| 197 <view-footer></view-footer> |
| 198 </template> |
| 199 </polymer-element> |
| 200 |
| 201 <script type="application/dart" src="heap_snapshot.dart"></script> |
| OLD | NEW |