limit memory allocation
glg: todo