Patent ID: 7853762

Claim:
A method of controlling storage capacity of a memory in a computer system, the method comprising: loading a first data segment in a random area of a memory from a hard disk; determining a first weighted factor for the first data segment based on an access frequency of the first data segment, the first weighted factor being increased by a first amount for each time the first data segment is accessed; determining a second weighted factor for the first data segment based on the size of the first data segment, the second weighted factor being decreased by a second amount for every particular storage amount in the size of the first data segment; calculating a weight for the first data segment stored at the random area in the memory based on a calculated sum of the first weighted factor that relates to access frequency of the first data segment and the second weighted factor that relates to the size of the first data segment; storing the calculated weight in a table along with weights calculated for every data segment stored at the random area in the memory; calculating, based on a list of the weights stored in the table, a removal rank for each data segment stored at the random area in the memory from the hard disk including the first data segment stored at the random area of the memory; storing the calculated removal ranks for each of the data segments in the table; determining that a whole storage capacity of the memory is utilized above a predetermined threshold; and in response to determining that the whole storage capacity of the memory is utilized above the predetermined threshold: accessing the stored removal ranks from the table; evaluating the accessed removal ranks to identify a removal rank that indicates a lowest benefit of being maintained in the random area in the memory based on a combination of access frequency and size of a data segment corresponding to the removal rank; and removing, from the random area in the memory, the data segment corresponding to the removal rank that indicates a lowest benefit of being maintained in the random area in the memory, wherein the second amount by which the second weighted factor is decreased for every particular storage amount in the size of the first data segment is different than the first amount by which the first weighted factor is increased for each time the first data segment is accessed.