Under the present invention, a method,
computer program product, and
system for non-blocking dynamic update of statically-typed class-based object-oriented
software executing as
byte-code on a
virtual machine within an actively running computer
system is provided. A set of objects instantiated from an existing module or multiple modules (identifiable collections of application resources and class definitions in the form of
byte-code representations) is ready for execution on a
virtual machine in an actively running computer
system. New versions of one or more modules corresponding to those already loaded into the actively running
virtual machine are dynamically loaded into the virtual
machine for the purpose of updating the running
software. The class definitions within the loaded modules are prepared for dynamic update by inserting
byte-code that enables; transparent state transfer and
shared object identity between objects of a former version and the new version of a class. On the event of a
software update, the objects instantiated from a former version of an updated class become un-initialized surrogate objects with the potential to redirect to their future corresponding objects. Corresponding objects are created lazily on first access of the declaring class members. Besides lazy redirection of the behavior of objects and classes, non-blocking dynamic update is achieved by lazy migration of the state of former objects and classes while locking on a temporary field access lock. Thus, the
algorithm for controlling field access and state migration is completely lock-free both before and after state migration; hence the performance degradation is minimal. Finally, any unreferenced objects are removed from memory.