mm: add a helper function to check may oom condition