Embodiments of the present invention relate to the field of computer. Provided are a memory resource optimization method and an apparatus, solving a mutual
impact problem between existing multi-level memory resources and optimizing an existing unitary division mechanism. A specific scheme is: obtaining performance data of each program in a
working set through a page coloring technology, obtaining a category of the each program by incorporating memory
access frequency, selecting a page coloring division policy corresponding to the
working set based on the category of the each program, inputting the page coloring division policy into an
operating system kernel, and completing corresponding coloring division
processing. The present invention is used for incorporating features of the
working set to eliminate or reduce mutual interference of processes and threads on memory resources, improving overall performance of a computer.