we hit this memory limit often in phabricator backup. this is all very crude but should suffice for now.