@GuardedBy("this") private void enforceUserMemoryLimit(long allocated, long delta, long maxMemory) { if (allocated + delta > maxMemory) { throw exceededLocalUserMemoryLimit(succinctBytes(maxMemory), getAdditionalFailureInfo(allocated, delta)); } }
@GuardedBy("this") private void enforceTotalMemoryLimit(long allocated, long delta, long maxMemory) { if (allocated + delta > maxMemory) { throw exceededLocalTotalMemoryLimit(succinctBytes(maxMemory), getAdditionalFailureInfo(allocated, delta)); } }