A method and system for improving the working set of a program image. The
working set (WS) improvement system of the present invention employs a
two-phase technique for improving the working set. In the first phase, the
WS improvement system inputs the program image and outputs a program image
with the locality of its references improved. In the second phase, the WS
improvement system inputs the program image with its locality of
references improved and outputs a program image with the placement of its
basic blocks in relation to page boundaries improved so that the working
set is reduced.