[Serve] fix _to_object_ref memory leak#43763
Conversation
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
Signed-off-by: Gene Su <e870252314@gmail.com>
|
Nice work tracking this down! What was the root cause of the leak? Why were |
Signed-off-by: Gene Su <e870252314@gmail.com>
|
Ah never mind, I took a closer look at the initial issue. Looks like the workload involved explicitly passing |
|
Credit to @edoakes! Couldn't have found the root cause without pairing 😄 |
Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com> Signed-off-by: Gene Der Su <gdsu@ucdavis.edu>
Co-authored-by: shrekris-anyscale <92341594+shrekris-anyscale@users.noreply.github.com> Signed-off-by: Gene Der Su <gdsu@ucdavis.edu>
It's because when we actually cloudpickle object refs, we want to pin them (because we don't know their lifecycle anymore). The |
Signed-off-by: Gene Su <e870252314@gmail.com>
|
@edoakes this is ready for merge |


Why are these changes needed?
_PyObjScanner/CloudPickleris designed to pin object refs into memory so they don't escape the scope of existing Ray session. This PR allowsObjectRefandObjectRefGeneratorto also escape the Ray memory pin so they won't cause memory leaks.Related issue number
Closes #43248
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.