[resource_quota] Apply fixes for memory pressure controller (#31860)

pull/31864/head
Craig Tiller 2 years ago committed by GitHub
parent 221d6b58d8
commit 988e39b5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/lib/resource_quota/memory_quota.h

@ -291,12 +291,12 @@ class BasicMemoryQuota final
// Data about current memory pressure.
struct PressureInfo {
// The current instantaneously measured memory pressure.
double instantaneous_pressure;
double instantaneous_pressure = 0.0;
// A control value that can be used to scale buffer sizes up or down to
// adjust memory pressure to our target set point.
double pressure_control_value;
double pressure_control_value = 0.0;
// Maximum recommended individual allocation size.
size_t max_recommended_allocation_size;
size_t max_recommended_allocation_size = 0;
};
explicit BasicMemoryQuota(std::string name) : name_(std::move(name)) {}
@ -530,6 +530,7 @@ class MemoryOwner final : public MemoryAllocator {
// Instantaneous memory pressure in the underlying quota.
BasicMemoryQuota::PressureInfo GetPressureInfo() const {
if (!is_valid()) return {};
return impl()->GetPressureInfo();
}

Loading…
Cancel
Save