Add low memory mode option to ART.
Useful so that we match the option I added here:
https://googleplex-android-review.googlesource.com/#/c/328940/
In ART low memory mode reduces the maximum number of histogram
buckets. We also trim no matter the utilization.
Change-Id: I655ba63312c0a6574569cdd5171ca81ea338c2aa
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 7615f98..3f91553 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -137,7 +137,7 @@
explicit Heap(size_t initial_size, size_t growth_limit, size_t min_free,
size_t max_free, double target_utilization, size_t capacity,
const std::string& original_image_file_name, bool concurrent_gc,
- size_t num_gc_threads);
+ size_t num_gc_threads, bool low_memory_mode);
~Heap();
@@ -276,6 +276,11 @@
verify_object_mode_ > kHeapVerificationNotPermitted;
}
+ // Returns true if low memory mode is enabled.
+ bool IsLowMemoryMode() const {
+ return low_memory_mode_;
+ }
+
void RecordFree(size_t freed_objects, size_t freed_bytes);
// Must be called if a field of an Object in the heap changes, and before any GC safe-point.
@@ -502,6 +507,9 @@
// How many GC threads we may use for garbage collection.
const bool num_gc_threads_;
+ // Boolean for if we are in low memory mode.
+ const bool low_memory_mode_;
+
// If we have a zygote space.
bool have_zygote_space_;