Methods and apparatus, including computer systems and program products,
for sharing data objects in runtime systems. An identification of a first
data object in a first runtime system is received. The first data object
references zero or more referenced data objects. A shared closure of data
objects, which consists of the first data object and a transitive closure
of the referenced data objects, is identified, and a determination is
made as to whether the shared closure of data objects is usable in a
second runtime system. In some implementations, determining whether a
shared closure is usable in a second runtime system includes determining
whether each data object in the shared closure is serializable without
execution of custom code, or determining whether the runtime class of
each object instance in the shared closure is shareable. Using shared
closures to share objects between runtime systems can provide isolation
between user sessions.