Revert "reset memory for tasks and actors to 5% when cached memory ad…" (#14556)

This reverts commit 6f151ad510.
This commit is contained in:
Ian Rodney 2021-03-09 08:19:55 -08:00 committed by GitHub
parent 134152937a
commit 6d5511cf80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -409,21 +409,6 @@ def get_system_memory():
return psutil_memory_in_bytes
def get_cached_memory():
"""Return the currently cached memory in bytes
Returns:
The total amount of cached memory
"""
# Try to accurately figure out the cached memory.
psutil_virtual_memory = psutil.virtual_memory()
psutil_cached_memory_in_bytes = 0
if hasattr(psutil_virtual_memory, "cached"):
psutil_cached_memory_in_bytes = psutil_virtual_memory.cached
return psutil_cached_memory_in_bytes
def _get_docker_cpus(
cpu_quota_file_name="/sys/fs/cgroup/cpu/cpu.cfs_quota_us",
cpu_share_file_name="/sys/fs/cgroup/cpu/cpu.cfs_period_us",
@ -551,11 +536,7 @@ def estimate_available_memory():
and total memory.
"""
# Linux, BSD has cached memory, which should
# also be considered as unused memory
# consider half of cached memory can be recycled.
# https://gitlab.com/procps-ng/procps/-/blob/master/proc/sysinfo.c#L805
return get_system_memory() - get_used_memory() + get_cached_memory() / 2
return get_system_memory() - get_used_memory()
def get_shared_memory_bytes():