google / tcmalloc

Apache License 2.0
4.31k stars 463 forks source link

Disabling tcmalloc cache #216

Closed coder-saab001 closed 6 months ago

coder-saab001 commented 9 months ago

Hi community, is there is some way to disable the tcmalloc cache totally. We are working on minimising the memory usage of our system.

junyer commented 8 months ago

I doubt that any answer given here will differ substantially from the answer given on https://github.com/gperftools/gperftools/issues/1466.

ckennelly commented 6 months ago

@junyer is correct. The caches hold onto freed objects by design, since they will likely be reused in the future.

TCMalloc has a number of heuristics to find unnecessary objects and flush them, but all of these are designed with a balance for CPU and RAM usage.