Some solutions have been suggested in downstream issue: https://github.com/facebook/rocksdb/issues/5223 As I focus on the packaging level bugs in MariaDB in Debian, I hope somebody else who knows more about FreeBSD and malloc libraries would produce a patch and test it...