google / tcmalloc

Apache License 2.0
4.31k stars 463 forks source link

System requirements for tcmalloc #196

Closed lgacnik closed 9 months ago

lgacnik commented 1 year ago

The following question is of informative nature.

I'm looking for an effective, preferably faster, and less time-deterministic alternative to malloc() memory allocator. I'm targetting use in C++ where code runs on a freestanding (no underlying operating system) implementation on a memory constrained device (microcontroller device with up to 1Mbyte of RAM/FLASH and sub-gigahertz frequency of CPU operation speed). Additionally I would be using such a memory allocation mechanism in combination with a pre-allocated (statically, at compile time, fixed-size container) memory and not dynamic (on heap) memory.

Therefore I'm asking whether tcmalloc is a suitable component for integration in such a system?

ckennelly commented 9 months ago

TCMalloc is not meant for heavily resource-constrained environments. A typical program will have several MBs of metadata for TCMalloc in excess of your available RAM.