memory limit automated

Handle memory limit for user, if possible.