This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 54a802d15be Fix for defect SOLR-18186: Solr heap used percentage uses
committed heap instead of max heap which raises false alarm (#4257)
54a802d15be is described below
commit 54a802d15be7b6e32cba9063cc706c94b35c25b8
Author: raviranjanjha <[email protected]>
AuthorDate: Mon Apr 6 13:33:40 2026 +0530
Fix for defect SOLR-18186: Solr heap used percentage uses committed heap
instead of max heap which raises false alarm (#4257)
---
changelog/unreleased/SOLR-18186-fix-heap-used-percent-adminui.yml | 7 +++++++
solr/webapp/web/js/angular/controllers/cloud.js | 4 +++-
solr/webapp/web/partials/cloud.html | 4 ++--
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/changelog/unreleased/SOLR-18186-fix-heap-used-percent-adminui.yml
b/changelog/unreleased/SOLR-18186-fix-heap-used-percent-adminui.yml
new file mode 100644
index 00000000000..2541d69a6a9
--- /dev/null
+++ b/changelog/unreleased/SOLR-18186-fix-heap-used-percent-adminui.yml
@@ -0,0 +1,7 @@
+title: Fixed Admin UI to use max heap (-Xmx) value instead of committed heap
to compute heap used percentage.
+type: fixed # added, changed, fixed, deprecated, removed, dependency_update,
security, other
+authors:
+ - name: Ravi Ranjan Jha
+links:
+ - name: SOLR-18186
+ url: https://issues.apache.org/jira/browse/SOLR-18186
diff --git a/solr/webapp/web/js/angular/controllers/cloud.js
b/solr/webapp/web/js/angular/controllers/cloud.js
index e88209fda56..f045583ef7f 100644
--- a/solr/webapp/web/js/angular/controllers/cloud.js
+++ b/solr/webapp/web/js/angular/controllers/cloud.js
@@ -367,12 +367,14 @@ var nodesSubController = function($scope, Collections,
System, Metrics, MetricsE
nodes[node]['memFree'] = bytesToSize(memFree);
nodes[node]['memUsed'] = bytesToSize(memTotal - memFree);
+ var heapMax = s.jvm.memory.raw.max;
var heapTotal = s.jvm.memory.raw.total;
var heapFree = s.jvm.memory.raw.free;
- var heapPercentage = Math.floor((heapTotal - heapFree) / heapTotal *
100);
+ var heapPercentage = Math.floor((heapTotal - heapFree) / heapMax *
100);
nodes[node]['heapUsed'] = bytesToSize(heapTotal - heapFree);
nodes[node]['heapUsedPct'] = heapPercentage;
nodes[node]['heapUsedPctStyle'] = styleForPct(heapPercentage);
+ nodes[node]['heapMax'] = bytesToSize(heapMax);
nodes[node]['heapTotal'] = bytesToSize(heapTotal);
nodes[node]['heapFree'] = bytesToSize(heapFree);
diff --git a/solr/webapp/web/partials/cloud.html
b/solr/webapp/web/partials/cloud.html
index ed72cbbc90e..480f72c1428 100644
--- a/solr/webapp/web/partials/cloud.html
+++ b/solr/webapp/web/partials/cloud.html
@@ -192,11 +192,11 @@ limitations under the License.
</div>
</td>
<td ng-class="{'dead-node': n.dead}">
- <div class="node-heap" title="total: {{n.heapTotal}} free:
{{n.heapFree}} used%: {{n.heapUsedPct}}%" ng-show="!n.dead">
+ <div class="node-heap" title="max: {{n.heapMax}} total:
{{n.heapTotal}} free: {{n.heapFree}} used%: {{n.heapUsedPct}}%"
ng-show="!n.dead">
<span
class="{{n.heapUsedPctStyle}}">{{n.heapUsedPct}}%</span>
</div>
<div class="node-spec" ng-show="showDetails[key] && !n.dead">
- Max: {{n.heapTotal}}<br/>
+ Max: {{n.heapMax}}<br/>
Used: {{n.heapUsed}}
</div>
</td>