Apply memory limit to 30M and recovery logic