Improve "apply memory working set" routine