commit | d30e1d6b477650366c25822f956202fec041e1d5 | [log] [tgz] |
---|---|---|
author | Mathieu Chartier <mathieuc@google.com> | Mon Jun 09 13:25:22 2014 -0700 |
committer | Mathieu Chartier <mathieuc@google.com> | Mon Jun 09 13:40:59 2014 -0700 |
tree | ab801a07914484354a47a36c0eef5ba20985e786 | |
parent | 2e1ca953c7fb165da36cc26ea74d3045d7e272c8 [diff] [blame] |
Fix GetFreeMemory to use fooprint limit instead of max memory. Based on definitions in: http://developer.android.com/reference/java/lang/Runtime.html Bug: 15507122 Change-Id: I02f34682d7ac2d379a07631b5207b6cfb224da6b
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 @@ // 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