Patent ID: 8819074

Claim:
A computer-implemented method for a database system, comprising: creating a first resource queue indicating an order of resources stored in a memory, each stored resource having a respective timestamp indicative of a last usage and the order being based on the respective timestamps associated with the stored resources; associating, by a processor of the computer, the first resource queue with a first queue timestamp; receiving a first command to deallocate a first amount of stored resources from the memory; determining, by the processor, that a first stored resource indicated by the first resource queue is associated with a timestamp earlier than the first queue timestamp; deallocating the first stored resource from the memory; receiving a second command to deallocate a second amount of stored resources from the memory; determining, by the processor, that the first resource queue indicates none of the stored resources are associated with a timestamp earlier than the first queue timestamp; and in response to the determination that the first resource queue indicates none of the stored resources are associated with a timestamp earlier than the first queue timestamp: creating a second resource queue indicating a second order of second resources stored in the memory, associating, by the processor, the second resource queue with the second queue timestamp; determining, by the processor, that a second stored resource indicated by the second queue is associated with a timestamp earlier than the second queue timestamp; and deallocating the second stored resource from the memory, each of the stored second resources having a respective timestamp indicative of a last usage and the second order being based on respective second timestamps associated with the stored second resources, wherein the second queue is not updated until all of the resources stored therein have been at least one of: deallocated and the second resource queue indicates none of the stored second resources are associated with a timestamp earlier than a second queue timestamp associated with the second resource queue.