Home | History | Annotate | Download | only in resources
      1 <!DOCTYPE HTML>
      2 
      3 <!--
      4 about:memory template page
      5 -->
      6 <html id="t">
      7   <head>
      8     <title>About Memory</title>
      9     <link rel="stylesheet" href="shared/css/about_memory.css">
     10 
     11 <style>
     12 body {
     13   font-family: Helvetica, sans-serif;
     14 }
     15 div#header select {
     16   font-family: Helvetica, sans-serif;
     17 }
     18 div.viewOptions input {
     19   font-family: Helvetica, sans-serif;
     20 }
     21 div.otherbrowsers {
     22   font-family: Helvetica, sans-serif;
     23 }
     24 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(1),
     25 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(6),
     26 table.list#browserComparison tr.firstRow th:nth-child(1) {
     27   border-right: 1px solid #b5c6de;
     28 }
     29 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(2),
     30 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(7),
     31 table.list#memoryDetails tr.firstRow th:nth-child(2) {
     32   border-right: 1px solid #b5c6de;
     33 }
     34 </style>
     35 <script>
     36 function reload() {
     37   if (document.getElementById('helpTooltip'))
     38     return;
     39   history.go(0);
     40 }
     41 
     42 function formatNumber(str) {
     43   str += '';
     44   if (str == '0') {
     45     return 'N/A ';
     46   }
     47   var x = str.split('.');
     48   var x1 = x[0];
     49   var x2 = x.length > 1 ? '.' + x[1] : '';
     50   var regex = /(\d+)(\d{3})/;
     51   while (regex.test(x1)) {
     52     x1 = x1.replace(regex, '$1' + ',' + '$2');
     53   }
     54   return x1;
     55 }
     56 
     57 function addToSum(id, value) {
     58   var target = document.getElementById(id);
     59   var sum = parseInt(target.innerHTML);
     60   sum += parseInt(value);
     61   target.innerHTML = sum;
     62 }
     63 
     64 function handleHelpTooltipMouseOver(event) {
     65   var el = document.createElement('div');
     66   el.id = 'helpTooltip';
     67   el.innerHTML = event.toElement.getElementsByTagName('div')[0].innerHTML;
     68   el.style.top = 0;
     69   el.style.left = 0;
     70   el.style.visibility = 'hidden';
     71   document.body.appendChild(el);
     72 
     73   var width = el.offsetWidth;
     74   var height = el.offsetHeight;
     75 
     76   if (event.pageX - width - 50 + document.body.scrollLeft >= 0 ) {
     77     el.style.left = (event.pageX - width - 20) + 'px';
     78   } else {
     79     el.style.left = (event.pageX + 20) + 'px';
     80   }
     81 
     82 
     83   if (event.pageY - height - 50 + document.body.scrollTop >= 0) {
     84     el.style.top = (event.pageY - height - 20) + 'px';
     85   } else {
     86     el.style.top = (event.pageY + 20) + 'px';
     87   }
     88 
     89   el.style.visibility = 'visible';
     90 }
     91 
     92 function handleHelpTooltipMouseOut(event) {
     93   var el = document.getElementById('helpTooltip');
     94   el.parentNode.removeChild(el);
     95 }
     96 
     97 function enableHelpTooltips() {
     98   var helpEls = document.getElementsByClassName('help');
     99 
    100   for (var i = 0, helpEl; helpEl = helpEls[i]; i++) {
    101     helpEl.onmouseover = handleHelpTooltipMouseOver;
    102     helpEl.onmouseout = handleHelpTooltipMouseOut;
    103   }
    104 }
    105 
    106 //setInterval("reload()", 10000);
    107 </script>
    108 </head>
    109 <body>
    110     <div id='header'>
    111       <h1>
    112         About memory
    113       </h1>
    114       <p>
    115         Measuring memory usage in a multi-process browser
    116       </p>
    117     </div>
    118 
    119     <div id='content'>
    120       <h2>
    121         Summary
    122         <div class='help'>
    123           <div>
    124             <p>
    125               Summary of memory used by currently active browsers.<p>
    126               For Chromium, processes used to to display diagnostics
    127               information (such as this "about:memory") are excluded.
    128             </p>
    129           </div>
    130         </div>
    131       </h2>
    132 
    133       <table class='list' id='browserComparison'>
    134         <colgroup>
    135           <col class='name' />
    136           <col class='number' />
    137           <col class='number' />
    138           <col class='number' />
    139           <col class='number' />
    140         </colgroup>
    141         <tr class='firstRow doNotFilter'>
    142           <th>
    143           </th>
    144           <th colspan='4'>
    145             Memory
    146             <div class='help'>
    147               <div>
    148                 <p>
    149                   <strong>Memory</strong>
    150                 </p>
    151                 <p>
    152                   <strong>Resident:</strong>
    153                   Amount of memory that is present in physical RAM.
    154                   This is the best indicator of browser memory resource usage.
    155                 </p>
    156                 <p>
    157                   <strong>Shared:</strong>
    158                   Amount of memory that is present in physical RAM and can
    159                   be shared with another process.
    160                 </p>
    161                 <p>
    162                   <strong>Private:</strong>
    163                   Amount of memory that is present in physical RAM and can not
    164                   be shared with another process.
    165                 </p>
    166                 <p>
    167                   <strong>Virtual:</strong>
    168                   Amount of address space allocated in virtual memory.
    169                 </p>
    170 
    171                 <p>
    172                   <i>(Note that the memory for this tab is not included in the browser totals.)</i>
    173                 </p>
    174               </div>
    175             </div>
    176           </th>
    177         </tr>
    178         <tr class='secondRow doNotFilter'>
    179           <th class='name'>
    180             Browser
    181           </th>
    182           <th class='number'>
    183             Resident
    184           </th>
    185           <th class='number'>
    186             Shared
    187           </th>
    188           <th class='number'>
    189             Private
    190           </th>
    191           <th class='number'>
    192             Virtual
    193           </th>
    194         </tr>
    195         <tr jsselect="browsers">
    196           <td class='name'>
    197             <div>
    198               <strong jscontent="name"></strong> <span jscontent="version"></span>
    199             </div>
    200           </td>
    201           <td class='number'>
    202             <span class='th' jscontent="formatNumber(ws_shareable)"></span><span class='k'>k</span>
    203           </td>
    204           <td class='number'>
    205             <span class='th' jscontent="formatNumber(ws_shared)"></span><span class='k'>k</span>
    206           </td>
    207           <td class='number'>
    208             <span class='th' jscontent="formatNumber(ws_priv)"></span><span class='k'>k</span>
    209           </td>
    210           <td class='number'>
    211             <span class='th' jscontent="formatNumber(comm_priv)"></span><span class='k'>k</span>
    212           </td>
    213         </tr>
    214       </table>
    215       <div class=otherbrowsers jsdisplay="browsers.length == 1">
    216         Note: If other browsers (e.g., Safari, Firefox, Camino) are running, I'll show their memory details here.
    217       </div>
    218       <div class="otherbrowsers">
    219         (Bug: We seriously overcount our own memory usage: <a href="http://crbug.com/25454">Issue 25454</a>.)
    220       </div>
    221 
    222       <br /><br /><br />
    223 
    224       <h2>
    225         Processes
    226         <div class='help'>
    227           <div>
    228             <p>
    229               Details of memory usage for each of Chromium's processes.
    230             </p>
    231           </div>
    232         </div>
    233       </h2>
    234 
    235       <table class='list' id='memoryDetails'>
    236         <colgroup>
    237           <col class='pid' />
    238           <col class='name' />
    239           <col class='number' />
    240           <col class='number' />
    241           <col class='number' />
    242           <col class='number' />
    243         </colgroup>
    244         <tr class='firstRow doNotFilter'>
    245           <th>
    246           </th>
    247           <th>
    248           </th>
    249           <th colspan='4'>
    250             Memory
    251           </th>
    252         </tr>
    253         <tr class='secondRow doNotFilter'>
    254           <th class='pid'>
    255             PID
    256           </th>
    257           <th class='name'>
    258             Name
    259           </th>
    260           <th class='number'>
    261             Resident
    262           </th>
    263           <th class='number'>
    264             Shared
    265           </th>
    266           <th class='number'>
    267             Private
    268           </th>
    269           <th class='number'>
    270             Virtual
    271           </th>
    272         </tr>
    273 
    274         <tr jsselect="browzr_data">
    275           <td class='pid'>
    276             <span class='th' jscontent="pid"></span>
    277           </td>
    278           <td class='name'>
    279             <div>
    280               Browser
    281             </div>
    282           </td>
    283           <td class='number'>
    284             <span class='th' jscontent="formatNumber(ws_shareable)"></span><span class='k'>k</span>
    285           </td>
    286           <td class='number'>
    287             <span class='th' jscontent="formatNumber(ws_shared)"></span><span class='k'>k</span>
    288           </td>
    289           <td class='number'>
    290             <span class='th' jscontent="formatNumber(ws_priv)"></span><span class='k'>k</span>
    291           </td>
    292           <td class='number'>
    293             <span class='th' jscontent="formatNumber(comm_priv)"></span><span class='k'>k</span>
    294           </td>
    295         </tr>
    296         <tr jsselect="child_data">
    297           <td class='pid'>
    298             <span class='th' jscontent="pid"></span>
    299           </td>
    300           <td class='name'>
    301             <div jscontent="child_name"></div>
    302             <div jsselect="titles">
    303               <span jscontent="$this"></span><br>
    304             </div>
    305           </td>
    306           <td class='number'>
    307             <span class='th' jscontent="formatNumber(ws_shareable)"></span><span class='k'>k</span>
    308           </td>
    309           <td class='number'>
    310             <span class='th' jscontent="formatNumber(ws_shared)"></span><span class='k'>k</span>
    311           </td>
    312           <td class='number'>
    313             <span class='th' jscontent="formatNumber(ws_priv)"></span><span class='k'>k</span>
    314           </td>
    315           <td class='number'>
    316             <span class='th' jscontent="formatNumber(comm_priv)"></span><span class='k'>k</span>
    317           </td>
    318         </tr>
    319 
    320         <tr class='noResults'>
    321           <td colspan='99'>
    322             No results found.
    323           </td>
    324         </tr>
    325       </table>
    326       <div class="otherbrowsers">
    327         (Note: Due to memory sharing between processes, summing memory usage does not give total memory usage.)
    328       </div>
    329     </div>
    330 </body>
    331 <script>
    332   enableHelpTooltips();
    333 </script>
    334 </html>
    335