summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-06-09 20:54:50 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-06-09 20:54:51 +0000
commit5d4a3fedcb18dadba5f50661e2a6d86890adfcbc (patch)
treeab801a07914484354a47a36c0eef5ba20985e786
parent2e1ca953c7fb165da36cc26ea74d3045d7e272c8 (diff)
parentd30e1d6b477650366c25822f956202fec041e1d5 (diff)
downloadart-5d4a3fedcb18dadba5f50661e2a6d86890adfcbc.zip
art-5d4a3fedcb18dadba5f50661e2a6d86890adfcbc.tar.gz
art-5d4a3fedcb18dadba5f50661e2a6d86890adfcbc.tar.bz2
Merge "Fix GetFreeMemory to use fooprint limit instead of max memory."
-rw-r--r--runtime/gc/heap.cc2
-rw-r--r--runtime/gc/heap.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index d7b673e..f5f7a86 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -2464,7 +2464,7 @@ void Heap::DumpForSigQuit(std::ostream& os) {
}
size_t Heap::GetPercentFree() {
- return static_cast<size_t>(100.0f * static_cast<float>(GetFreeMemory()) / GetMaxMemory());
+ return static_cast<size_t>(100.0f * static_cast<float>(GetFreeMemory()) / max_allowed_footprint_);
}
void Heap::SetIdealFootprint(size_t max_allowed_footprint) {
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index e568b36..9b49373 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -408,7 +408,7 @@ class Heap {
// Implements java.lang.Runtime.freeMemory.
size_t GetFreeMemory() const {
- return GetMaxMemory() - num_bytes_allocated_.LoadSequentiallyConsistent();
+ return max_allowed_footprint_ - num_bytes_allocated_.LoadSequentiallyConsistent();
}
// get the space that corresponds to an object's address. Current implementation searches all