Class libraries are generally designed with an emphasis on versatility
and extensibility. Applications that use a library typically exercise
only part of the library's functionality. As a result, objects create
d by the application may contain unused members. We present an algorit
hm that specializes a class hierarchy with respect to its usage in a p
rogram p. That is, the algorithm analyzes the member access patterns f
or P's variables, and creates distinct classes for variables that acce
ss different members. Class hierarchy specialization reduces object si
ze, and is hence primarily a space optimization. However, execution ti
me may also be reduced through reduced object creation/destruction tim
e, and caching/paging effects.