reset resource limits when resize() returns
Merge branch 'max-memory'