Setting ` MALLOC_TRIM_THRESHOLD_` on a LocalCluster

Dear all, I’m struggling a lot with memory leaks (similarly to what has been reported here) and I’d like to set MALLOC_TRIM_THRESHOLD_ to zero as suggested on the dask documentation

But I’m on a LocalCluster - does someone know how to set this option on a local machine?

I have the same problem

After looking a bit more the correct way seems to be described here, but it doesn’t work as of dask stable.

@fmaussion Welcome to Discourse!

After looking a bit more the correct way seems to be described here , but it doesn’t work as of dask stable.

Do you mean, the “production workaround” isn’t working? If so, I’d encourage you to chime in on the GitHub issue, it’ll allow the developers to better understand+diagnose what’s going on. :smile:

I don’t know how to apply the production workaround in pure python code (I’m starting the cluster from Jupyter)

I don’t know how to apply the production workaround in pure python code (I’m starting the cluster from Jupyter)

Since it’s a known bug, I don’t think there is another workaround for Jupyter. Feel free to still ask on the GitHub issue to be sure!

The issue has been fixed in 2022.8.1. There’s no more need for workarounds.