mem: improve best-effort allocation