Extend error reporting in art::gc::Heap::GrowForUtilization.
Test: art/test.py
Bug: 73712520
Change-Id: I425368fd0bb69241e986b38c40a541e8f5c05c59
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 17913fc..cb43601 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -3453,7 +3453,8 @@
if (gc_type != collector::kGcTypeSticky) {
// Grow the heap for non sticky GC.
ssize_t delta = bytes_allocated / GetTargetHeapUtilization() - bytes_allocated;
- CHECK_GE(delta, 0);
+ CHECK_GE(delta, 0) << "bytes_allocated=" << bytes_allocated
+ << " target_utilization_=" << target_utilization_;
target_size = bytes_allocated + delta * multiplier;
target_size = std::min(target_size, bytes_allocated + adjusted_max_free);
target_size = std::max(target_size, bytes_allocated + adjusted_min_free);