Patent ID: 7949848

Claim:
A method of reducing memory usage of an object oriented program within a data processing apparatus, the object oriented program comprising at least one class definition used to create objects, each class definition providing at least one function that can be run in respect of objects created from that class definition, and identifying a number of storage items to be provided in memory for each object to store data values associated with the object, for each class definition the method being performed prior to any objects being created from that class definition, and being performed in respect of at least a subset of the storage items identified by that class definition, the method comprising the steps of: (a) determining an original size associated with each storage item; (b) analysing at least the class definition to identify any numeric ranges associated with the storage items; (c) for each storage item for which a numeric range is identified, determining if the original size can be reduced whilst still supporting the numeric range, and if so allocating to that storage item a modified size less than the original size; and (d) altering the class definition having regard to any storage item that has been allocated a modified size.