Patent ID: 8095766

Claim:
A method for calculating memory size requirements of an object, comprising: receiving, by a computer, a new object that is to be stored in a memory cache, acquiring, by the computer, a known memory size of a similar object with at least one fixed size component, using, by the computer, the known memory size of the similar object to approximate a memory size required by the new object by determining that at least one fixed size component of the new object is equivalent in size to a respective fixed size component of the similar object, calculating, by the computer, an actual size of each of one or more variable sized components of the new object, approximating, by the computer, the total size of the new object using the known memory size of the similar object and the calculated actual size of the one or more variable sized components of the new object, and storing, by the computer, the new object in the memory cache if there is available space in the memory cache.