OpenSSL allows overriding its allocator with CRYPTO_set_mem_functions(), currently _ssl and _hashopenssl use the default system malloc. I am filing this issue to investigate if we can set it to PyMem_Raw* so that on free-threading it uses mimalloc which would scale better. Previously, there have been reports of high memory usage of ssl on glibc allocator, it would be worth checking if doing this fixes that as well.
Linked PRs
OpenSSL allows overriding its allocator with
CRYPTO_set_mem_functions(), currently_ssland_hashopenssluse the default system malloc. I am filing this issue to investigate if we can set it toPyMem_Raw*so that on free-threading it uses mimalloc which would scale better. Previously, there have been reports of high memory usage of ssl on glibc allocator, it would be worth checking if doing this fixes that as well.Linked PRs