Changeset 6762


Ignore:
Timestamp:
Mar 9, 2015, 8:39:48 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1924: Test BASE with Java 8

Fixed memory statistics to support -1 for max memory for some memory spaces (eg. Metaspace memory which replaces the PermGen? space).

No more OutOfMEmoryError: PermGenSpace!! http://java.dzone.com/articles/java-8-permgen-metaspace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/info/about.jsp

    r6684 r6762  
    172172      for (MemoryType mtype : MemoryType.values())
    173173      {
    174         long sumUsed = 0;
     174        long sumUsed =  0;
    175175        long sumMax = 0;
    176176        for (MemoryPoolMXBean mbean : beans)
     
    179179          {
    180180            MemoryUsage usage = mbean.getUsage();
    181             sumUsed += usage.getUsed();
    182             sumMax += usage.getMax();
    183             long percent = 100*usage.getUsed() / usage.getMax();
     181            long used = usage.getUsed();
     182            long max = usage.getMax();
     183            long percent = -1;
     184            if (max > 0)
     185            {
     186              sumMax += max;
     187              sumUsed += used;
     188              percent = 100*used/max;
     189            }
    184190            %>
    185191            <tr>
    186             <td><%=mbean.getName() %></td>
    187             <td><%=Values.formatBytes(usage.getUsed()) %></td>
    188             <td><%=Values.formatBytes(usage.getMax()) %></td>
    189             <td class="<%=percent > 75 ? "memory-warning" : "" %>"><%=percent %>%</td>
     192            <td><%=mbean.getName() %><%=max <= 0 ? "¹" : ""%></td>
     193            <td><%=Values.formatBytes(used) %></td>
     194            <td><%=max > 0 ? Values.formatBytes(max) : "no limit"%></td>
     195            <td class="<%=percent > 75 ? "memory-warning" : "" %>"><%=percent == -1 ? "-" : percent + "%" %></td>
    190196            </tr>
    191197          <%
     
    202208      }
    203209      %>
    204      
    205210      </table>
     211      ¹Not included in sum
    206212  </tr>
    207213  </table>
Note: See TracChangeset for help on using the changeset viewer.