# Confused on the behavior of "RAY\_task\_oom\_retries" in Actor restarts

**URL:** <https://discuss.ray.io/t/confused-on-the-behavior-of-ray-task-oom-retries-in-actor-restarts/11146>\
**Category:** Ray Core\
**Created:** [June 23, 2023, 9:22pm UTC](https://discuss.ray.io/t/confused-on-the-behavior-of-ray-task-oom-retries-in-actor-restarts/11146 "2023-06-23T21:22:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cemk](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/cemk/32/2299_2.png) [@cemk](https://discuss.ray.io/u/cemk)\
**Post date:** [June 23, 2023, 9:22pm UTC](https://discuss.ray.io/t/confused-on-the-behavior-of-ray-task-oom-retries-in-actor-restarts/11146/1 "2023-06-23T21:22:26Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- None: Just asking a question out of curiosity

Hi all, while perusing the config.h file here [ray/src/ray/common/ray\_config\_def.h at ray-2.3.0 · ray-project/ray · GitHub](https://github.com/ray-project/ray/blob/ray-2.3.0/src/ray/common/ray_config_def.h)

I stumbled upon this environment flag `RAY_task_oom_retries` which is set to -1 by default. I am confused as to the implications of this flag on actor restarts.

1. In the description this seems to imply that when an actor is killed by the memory monitor due to OOM (hence the actor also dies) dose this not count as a restart in the max\_restarts? In which case I think this is not documented in the actor fault tolerance or actor page on the Ray docs because I was under the impression that any actor restart will decrease the max\_restarts counter.

---

<div class="post-metadata">

**Author:** ![yic](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/yic/32/437_2.png) [@yic](https://discuss.ray.io/u/yic)\
**Post date:** [June 26, 2023, 9:34pm UTC](https://discuss.ray.io/t/confused-on-the-behavior-of-ray-task-oom-retries-in-actor-restarts/11146/2 "2023-06-26T21:34:02Z")

</div>

@cemk OOM retries and the max\_retries are two separate counters. If the task failed due to OOM, it’ll use the oom counter. So if it’s set to 1, and it OOMed twice, it won’t retry.

> <https://github.com/ray-project/ray/blob/master/src/ray/core_worker/task_manager.cc#L795>
