A system and method are disclosed for decreasing the number of duplicate
library copies loaded into memory without endangering the security of
applications in a runtime environment. In a preferred embodiment,
applications in the runtime environment may be provided with a delegation
classloader that identifies any libraries referenced by the delegation
classloader's respective application. The delegation classloaders then
delegate the task of providing the referenced libraries to a distinct
software component. In a preferred embodiment, the distinct software
component may be another delegation classloader or other loader adapted
to look at a single library or a small set of libraries. These "atomic"
classloaders can be freely shared by multiple applications since they do
not expose any application's internals. Each atomic classloader
preferably loads one copy of its associated library or libraries into
memory. This single instance of shared library code is made available to
multiple applications without requiring explicit cooperation between
applications or endangering their security.