document internal memory allocation, how to avoid