MCPcopy Create free account
hub / github.com/apache/impala / SoftLimitExceeded

Function SoftLimitExceeded

be/src/kudu/util/process_memory.cc:245–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245bool SoftLimitExceeded(double* current_capacity_pct) {
246 InitLimits();
247 int64_t consumption = CurrentConsumption();
248 // Did we exceed the actual limit?
249 if (consumption > g_hard_limit) {
250 if (current_capacity_pct) {
251 *current_capacity_pct = static_cast<double>(consumption) / g_hard_limit * 100;
252 }
253 return true;
254 }
255
256 // No soft limit defined.
257 if (g_hard_limit == g_soft_limit) {
258 return false;
259 }
260
261 // Are we under the soft limit threshold?
262 if (consumption < g_soft_limit) {
263 return false;
264 }
265
266 // We're over the threshold; were we randomly chosen to be over the soft limit?
267 if (consumption + g_rand->Uniform64(g_hard_limit - g_soft_limit) > g_hard_limit) {
268 if (current_capacity_pct) {
269 *current_capacity_pct = static_cast<double>(consumption) / g_hard_limit * 100;
270 }
271 return true;
272 }
273 return false;
274}
275
276void MaybeGCAfterRelease(int64_t released_bytes) {
277#ifdef TCMALLOC_ENABLED

Callers

nothing calls this directly

Calls 3

InitLimitsFunction · 0.85
CurrentConsumptionFunction · 0.85
Uniform64Method · 0.45

Tested by

no test coverage detected