Curator icon indicating copy to clipboard operation
Curator copied to clipboard

Ray temp directory memory leak

Open kipraveen opened this issue 11 months ago • 3 comments

Describe the bug

Ray temp directory memory leak when running tasks multiple times.

Steps/Code to reproduce bug

Run any nemo curator pipeline which uses the ray cluster multiple times. Observe the size of the directory at /tmp/ray

Expected behavior

Size of the temp directory does not keep on increasing.

kipraveen avatar Dec 12 '25 05:12 kipraveen

Thanks a couple of questions:

  1. Are you running this in a container or bare metal?

Run any nemo curator pipeline which uses the ray cluster multiple times.

To clarify some information here is it the same cluster running multiple pipelines or are you starting up different clusters for different jobs? Does the memory clear up when the cluster is stopped?

ayushdg avatar Dec 12 '25 16:12 ayushdg

Sorry for missing the details of my run.

I am running nemo curator inside a docker container with pip install.

For the second question, even after the python script exits, the temp directory is not cleaned up. It just keeps on adding to the same temp directory in subsequent runs.

kipraveen avatar Dec 13 '25 12:12 kipraveen

Thanks for that information. The Ray object store uses shared memory for allocations. In containers where the default shared memory is super small Ray defaults to using /tmp instead. For container runs I would recommend setting a larger shm size when starting the container.

With docker you can use something like this --shm-size 500000000000 to ensure /dev/shm is used for the object store instead of /tmp.

I would assume that ray would clean up the object store/tmp memory even after exiting the python program but I'll need to look into that

ayushdg avatar Jan 06 '26 19:01 ayushdg