Index: storage/common/blob_storage/blob_storage_constants.h |
diff --git a/storage/common/blob_storage/blob_storage_constants.h b/storage/common/blob_storage/blob_storage_constants.h |
index f51b012bc07c7b9570688eb9d516b4dd557b4516..e31c41d22a682ed6ef52d0e98dfda35aeb0c177f 100644 |
--- a/storage/common/blob_storage/blob_storage_constants.h |
+++ b/storage/common/blob_storage/blob_storage_constants.h |
@@ -23,8 +23,10 @@ constexpr uint64_t kDefaultMaxPageFileSize = 100ull * 1024 * 1024; |
#if defined(OS_ANDROID) |
// On minimal Android maximum in-memory space can be as low as 5MB. |
constexpr uint64_t kDefaultMinPageFileSize = 5ull * 1024 * 1024 / 2; |
+const float kDefaultMinPageFileSizeRatioUnderPressure = 0.02; |
#else |
constexpr uint64_t kDefaultMinPageFileSize = 5ull * 1024 * 1024; |
+const float kDefaultMinPageFileSizeRatioUnderPressure = 0.002; |
#endif |
// All sizes are in bytes. |
@@ -61,6 +63,11 @@ struct STORAGE_COMMON_EXPORT BlobStorageLimits { |
// This is the minimum file size we can use when paging blob items to disk. |
// We combine items until we reach at least this size. |
uint64_t min_page_file_size = kDefaultMinPageFileSize; |
+ // Ratio of minimum page file size to use to the |max_blob_in_memory_space|, |
+ // when under memory pressure (to avoid causing peaks due to file write |
+ // buffers). |
+ float min_page_file_size_ratio_under_pressure = |
dmurph
2017/05/10 19:13:34
Can we put this in terms of the memory limit inste
ssid
2017/05/12 01:38:01
Done.
|
+ kDefaultMinPageFileSizeRatioUnderPressure; |
// This is the maximum file size we can create. |
uint64_t max_file_size = kDefaultMaxPageFileSize; |
}; |