Many class libraries are designed with an emphasis on generality and extensibility.
Applications often exercise only part of a library's functionality.
Redundant members in objects are undesirable because they increase an application's memory usage. We present an algorithm for specializing a class hierarchy with respect to its usage in a program P . That is, the algorithm analyzes the member access patterns for P 's variables, and creates distinct classes for variables that access different members. Class hierarchy specialization reduces object size, and can be viewed as a space optimization. However, execution time may also be reduced through reduced object creation or destruction time, and caching and paging effects.