Methods and apparatus, including computer systems and program products,
for sharing objects in runtime systems and for providing isolation
between user sessions in a scalable manner. A user context corresponding
to a user session is stored in a shared memory area. Upon receiving a
request corresponding to the user session, a process is selected from a
set of operating system processes, and a runtime system is selected from
a set of runtime systems. The runtime system is bound to the process, and
the user context is associated with the runtime system to process the
request. In some implementations, sharing user contexts enables virtual
machines to be used in a shared but isolated manner: Each user context
can be exclusively associated with an available virtual machine from a
fixed set of virtual machines, and each virtual machine can be
exclusively executed in an available process from a fixed set of
processes.