I run a c++ program that uses jemalloc as memory allocator which pre-divides big chunks into small chunks of pre-defined sizes (i.e. 1, 2, 4, 8, ... bytes)
Even though I ask 110 bytes of memory allocation, it returns a memory with 128 bytes capacity.
In my program, I track the amount of dynamically allocated memory (with highly diverse size) and limit the memory allocation of threads to avoid OutOfMemory crash.
However, due to the discrepancy between the size requested and the actual size granted, I cannot exactly count the amounts of dynamically allocated bytes.
Is there any 'jemalloc' API that receives a request size as an input and provides an actual allocation size as an output?
Thanks