how solve the memory problem