Skip to content

Commit

Permalink
[Serve] Address incremental memory leak due to _PyObjScanner (#31317)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-mo authored Dec 23, 2022
1 parent 1e42e6c commit 01b19ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/ray/dag/dag_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def _get_all_child_nodes(self) -> List["DAGNode"]:
):
if n not in children:
children.append(n)
scanner.clear()
return children

def _apply_and_replace_all_child_nodes(
Expand Down Expand Up @@ -210,6 +211,7 @@ def _apply_and_replace_all_child_nodes(
new_args, new_kwargs, new_other_args_to_resolve = scanner.replace_nodes(
replace_table
)
scanner.clear()

# Return updated copy of self.
return self._copy(
Expand Down Expand Up @@ -288,6 +290,7 @@ def apply_functional(
replace_table[node] = apply_fn(node)

replaced_inputs = scanner.replace_nodes(replace_table)
scanner.clear()

return replaced_inputs

Expand Down

0 comments on commit 01b19ba

Please sign in to comment.