summaryrefslogtreecommitdiff
path: root/runtime/gc/allocator/rosalloc.cc
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2021-05-18 04:16:06 -0700
committer Lokesh Gidra <lokeshgidra@google.com> 2021-05-19 16:34:14 +0000
commit26e9e75dc4ef6fbe863651e29aaaeff00edcdf92 (patch)
tree90189425907c2fd8642470a71d65d59a1bb70e7e /runtime/gc/allocator/rosalloc.cc
parent1dc77abf87d303a8f4aa35148c57f7ab20832222 (diff)
Improve OOME log message informing OOME before heap full
We throw OOME when <1% of the heap is free after GC. We should improve the corresponding log message to clarify why we throw OOME even when allocation size is < largest contiguous chunk. Test: art/test/testrunner/testrunner.py Bug: 188465700 Change-Id: I71bf744a3966271ba31f336f7ceb58c848105df7
Diffstat (limited to 'runtime/gc/allocator/rosalloc.cc')
-rw-r--r--runtime/gc/allocator/rosalloc.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index f1572cd6ee..269887476c 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -2069,7 +2069,7 @@ size_t RosAlloc::ReleasePageRange(uint8_t* start, uint8_t* end) {
return reclaimed_bytes;
}
-void RosAlloc::LogFragmentationAllocFailure(std::ostream& os, size_t failed_alloc_bytes) {
+bool RosAlloc::LogFragmentationAllocFailure(std::ostream& os, size_t failed_alloc_bytes) {
Thread* self = Thread::Current();
size_t largest_continuous_free_pages = 0;
WriterMutexLock wmu(self, bulk_free_lock_);
@@ -2098,7 +2098,9 @@ void RosAlloc::LogFragmentationAllocFailure(std::ostream& os, size_t failed_allo
<< ", space footprint " << footprint_ << " bytes"
<< ", space max capacity " << max_capacity_ << " bytes"
<< ")" << std::endl;
+ return true;
}
+ return false;
}
void RosAlloc::DumpStats(std::ostream& os) {