mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
Revert "reset memory for tasks and actors to 5% when cached memory ad…" (#14556)
This reverts commit 6f151ad510
.
This commit is contained in:
parent
134152937a
commit
6d5511cf80
1 changed files with 1 additions and 20 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Reference in a new issue