Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor(memoryReport) make the free memory report what is left available to the jvm #30948

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,44 @@
</a>
</div>
<%}%>

<%

long maxMemory = Runtime.getRuntime().maxMemory();
long totalMemoryInUse = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
long usedMemory = totalMemoryInUse - freeMemory;
long availableMemory = maxMemory - usedMemory;

%>


<link rel="stylesheet" href="/html/js/sortable-0.8.0/css/sortable-theme-minimal.css" />
<script src="/html/js/sortable-0.8.0/js/sortable.min.js"></script>
<div style="padding-bottom:30px;">
<table class="listingTable shadowBox" style="width:400px">
<tr>
<th><%= LanguageUtil.get(pageContext, "Total-Memory-Available") %>
<th><%= LanguageUtil.get( pageContext, "Total-Memory-Available" ) %> / Xmx
</th>
<td align="right"><%=UtilMethods.prettyByteify(Runtime.getRuntime().maxMemory())%>
<td align="right"><%=UtilMethods.prettyByteify( maxMemory )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get(pageContext, "Memory-Allocated") %>
<th><%= LanguageUtil.get( pageContext, "Memory-Allocated" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify(Runtime.getRuntime().totalMemory())%>
<td align="right"><%= UtilMethods.prettyByteify( totalMemoryInUse )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get(pageContext, "Filled-Memory") %>
<th><%= LanguageUtil.get( pageContext, "Filled-Memory" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())%>
<td align="right"><%= UtilMethods.prettyByteify( usedMemory )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get(pageContext, "Free-Memory") %>
<th><%= LanguageUtil.get( pageContext, "Free-Memory" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify(Runtime.getRuntime().freeMemory())%>
<td align="right"><%= UtilMethods.prettyByteify( availableMemory )%>
</td>
</tr>
</table>
Expand Down Expand Up @@ -95,4 +107,4 @@ dojo.ready(function() {



</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -1295,31 +1295,40 @@ dd.leftdl {
<div id="cacheStatsCp" dojoType="dojox.layout.ContentPane" parseOnLoad="true" style="text-align: center;min-height: 100px;">


<%

long maxMemory = Runtime.getRuntime().maxMemory();
long totalMemoryInUse = Runtime.getRuntime().totalMemory();
long freeMemory = Runtime.getRuntime().freeMemory();
long usedMemory = totalMemoryInUse - freeMemory;
long availableMemory = maxMemory - usedMemory;

%>
<div style="padding-bottom:30px;">

<table class="listingTable shadowBox" style="width:400px">
<tr>
<th><%= LanguageUtil.get( pageContext, "Total-Memory-Available" ) %>
<th><%= LanguageUtil.get( pageContext, "Total-Memory-Available" ) %> / Xmx
</th>
<td align="right"><%=UtilMethods.prettyByteify( Runtime.getRuntime().maxMemory() )%>
<td align="right"><%=UtilMethods.prettyByteify( maxMemory )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get( pageContext, "Memory-Allocated" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify( Runtime.getRuntime().totalMemory() )%>
<td align="right"><%= UtilMethods.prettyByteify( totalMemoryInUse )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get( pageContext, "Filled-Memory" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify( Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() )%>
<td align="right"><%= UtilMethods.prettyByteify( usedMemory )%>
</td>
</tr>
<tr>
<th><%= LanguageUtil.get( pageContext, "Free-Memory" ) %>
</th>
<td align="right"><%= UtilMethods.prettyByteify( Runtime.getRuntime().freeMemory() )%>
<td align="right"><%= UtilMethods.prettyByteify( availableMemory )%>
</td>
</tr>
</table>
Expand Down
Loading