<%
  if (memory == "not_available") {
%>
<p class="warning">
  Memory statistics not available.
</p>
<% } else { %>
<%= format('memory-bar', {sections: MEMORY_STATISTICS.sections, memory: memory, total_out: []}) %>
<span class="clear">&nbsp;</span>
<div class="box">
<%= format('memory-table', {key: MEMORY_STATISTICS.keys, memory: memory}) %>
</div>

<div class="memory-info">
  Last updated: <b><%= fmt_date(new Date()) %></b>.<br/>
  Memory calculation strategy: <b><%= memory.strategy %></b>. <span class="help" id="memory-calculation-strategy-breakdown"></span><br/><br/>
  Amount of memory used vs. allocated during last update: <span class="help" id="memory-use"></span><br/>
  <table class="facts">
      <tr>
        <th>Runtime Used</th>
        <td><%= fmt_bytes(memory.total.erlang) %></td>
      </tr>
      <tr>
        <th>Runtime Allocated</th>
        <td><%= fmt_bytes(memory.total.allocated) %></td>
      </tr>
      <tr>
        <th>Resident Set Size (RSS) reported by the OS</th>
        <td><%= fmt_bytes(memory.total.rss) %></td>
      </tr>
    </table>
</div>

<% } %>
