per thread memory allocation