Changeset 6676


Ignore:
Timestamp:
Jan 12, 2015, 2:17:19 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1904: Display more memory usage details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.4-stable/www/info/about.jsp

    r6610 r6676  
    3838  import="java.sql.Driver"
    3939  import="java.util.Properties"
     40  import="java.util.List"
     41  import="java.lang.management.ManagementFactory"
     42  import="java.lang.management.MemoryPoolMXBean"
     43  import="java.lang.management.MemoryUsage"
    4044%>
    4145<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
     
    6367final Properties properties = System.getProperties();
    6468final Runtime runtime = Runtime.getRuntime();
    65 
     69List<MemoryPoolMXBean> beans = ManagementFactory.getMemoryPoolMXBeans();
    6670%>
    6771<base:page type="popup" title="About">
    68 <base:head scripts="tabcontrol-2.js,~info.js" styles="tabcontrol.css" />
     72<base:head scripts="tabcontrol-2.js,~info.js" styles="tabcontrol.css">
     73<style>
     74#memoryTable th, #memoryTable td
     75{
     76  text-align: right;
     77  padding-left: 1em;
     78  padding-right: 1.5em;
     79}
     80</style>
     81</base:head>
    6982<base:body data-read-only="1">
    7083  <h1>BASE - BioArray Software Environment</h1>
     
    135148      </td>
    136149  </tr>
    137   <tr>
     150  <tr class="dynamic">
    138151    <th>Memory</th>
    139     <td class="info">Total: <%=Values.formatBytes(runtime.totalMemory())%><br>
    140       Free: <%=Values.formatBytes(runtime.freeMemory()) %><br>
    141       Max: <%=Values.formatBytes(runtime.maxMemory()) %></td>
    142   </tr>
    143   <tr class="dynamic">
    144     <th></th>
    145     <td></td>
     152    <td class="info">
     153     
     154      <table id="memoryTable" style="xwidth:100%;">
     155      <tr style="border-bottom-width: 1px;">
     156        <th>Region</th>
     157        <th>Used</th>
     158        <th>Max</th>
     159        <th></th>
     160      </tr>
     161      <tr>
     162        <td>Heap</td>
     163        <td><%=Values.formatBytes(runtime.totalMemory()-runtime.freeMemory()) %></td>
     164        <td><%=Values.formatBytes(runtime.maxMemory())%></td>
     165        <td><%=100*(runtime.totalMemory()-runtime.freeMemory()) / runtime.maxMemory() %>%
     166      </tr>
     167      <%
     168      for (MemoryPoolMXBean mbean : beans)
     169      {
     170        MemoryUsage usage = mbean.getUsage();
     171        %>
     172        <tr>
     173        <td><%=mbean.getName() %></td>
     174        <td><%=Values.formatBytes(usage.getUsed()) %></td>
     175        <td><%=Values.formatBytes(usage.getMax()) %></td>
     176        <td><%=100*usage.getUsed() / usage.getMax() %>%
     177        </tr>
     178        <%
     179      }
     180      %>
     181      </table>
    146182  </tr>
    147183  </table>
Note: See TracChangeset for help on using the changeset viewer.