-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ray] Fix ray memory leak #3184
Conversation
b0a904d
to
5fd8c46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
You mean free the local vars (ResultMessage object) in |
Yes, local vars (ResultMessage object) in |
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
What do these changes do?
The memory leak is because when starting session by the
new_ray_session
, the global router is not set. There is a_set_global_router
in ActorPoolBase::create, but thenew_ray_session
calls the create method in Ray actor. So, driver still has empty global router.The memory leak details:
new_ray_session
has not called theRouter.set_instance
.Router.get_instance_or_empty()
, a new Router instance will be created.router.get_client(...)
creates a new client instance inActorCaller
.asyncio.create_task(self._listen(client))
creates a new coroutine_listen
._listen
coroutine captures the returnedResultMessage
in frame.Before
After
Related issue number
Fixes #3183
Fixes #3173
Check code requirements