Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Unified Diff: tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js

Issue 563183003: [Android] memory_inspector: add resident memory accounting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mi4
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js b/tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js
index 005a42a8095b9244f0289d9169f311682ba10d3c..91190c2550736e1a695e66c2135566190a805500 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js
+++ b/tools/memory_inspector/memory_inspector/frontends/www_content/js/nheap.js
@@ -4,8 +4,10 @@
nheap = new (function() {
-this.COL_STACKTRACE = 3;
this.COL_TOTAL = 0;
+this.COL_RESIDENT = 1;
+this.COL_STACKTRACE = 3;
+
this.nheapData_ = null;
this.nheapTable_ = null;
@@ -44,17 +46,20 @@ this.applyTableFilters_ = function() {
var rx = $('#nheap-filter').val();
var rows = [];
- var total = 0;
+ var total_allocated = 0;
+ var total_resident = 0;
for (var row = 0; row < this.nheapData_.getNumberOfRows(); ++row) {
stackTrace = this.nheapData_.getValue(row, this.COL_STACKTRACE);
if (!stackTrace.match(rx))
continue;
rows.push(row);
- total += this.nheapData_.getValue(row, this.COL_TOTAL);
+ total_allocated += this.nheapData_.getValue(row, this.COL_TOTAL);
+ total_resident += this.nheapData_.getValue(row, this.COL_RESIDENT);
}
- $('#nheap-totals').val(Math.floor(total / 1024) + ' KB');
+ $('#nheap-total-allocated').val(Math.floor(total_allocated / 1024) + ' KB');
+ $('#nheap-total-resident').val(Math.floor(total_resident / 1024) + ' KB');
this.nheapFilter_.setRows(rows);
this.redraw();
};
@@ -63,14 +68,18 @@ this.onNheapTableRowSelect_ = function() {
if (!this.nheapFilter_)
return;
- var total = 0;
+ var total_allocated = 0;
+ var total_resident = 0;
this.nheapTable_.getSelection().forEach(function(sel) {
var row = sel.row;
- total += this.nheapFilter_.getValue(row, this.COL_TOTAL);
+ total_allocated += this.nheapFilter_.getValue(row, this.COL_TOTAL);
+ total_resident += this.nheapFilter_.getValue(row, this.COL_RESIDENT);
}, this);
- $('#nheap-selected').val(Math.floor(total / 1024) + ' KB');
+ $('#nheap-selected-allocated').val(Math.floor(total_allocated / 1024) +
+ ' KB');
+ $('#nheap-selected-resident').val(Math.floor(total_resident / 1024) + ' KB');
};
this.redraw = function() {

Powered by Google App Engine
This is Rietveld 408576698