Patent ID: 8286154

Claim:
A method for dynamically upgrading one or more object instances of a running program, the method comprising: loading a new version of a class, the new version of the class being an updated version of an old version of the class, the old version of the class have a first layout of data elements and the new version of the class having a second layout of data elements; setting a flag in response to the loading of the new version of the class; initiating a garbage collection process that includes: determining if the flag is set; when the flag is not set, performing a normal garbage collection; and when the flag is set, scanning a memory where at least one or more old object instances of the running program are stored, identifying the one or more old object instances contained in the memory, and recording one or more addresses of the one or more old object instances stored in the memory and one or more references to the one or more old object instances, the one or more old object instances having been created from the old version of the class; and initiating a live load after the garbage collection process has recorded the one or more addresses of the one or more old object instances that includes: for each of the one or more recorded addresses: selecting the old object instance stored at the address; updating method information in the selected old object instance to identify one or more methods defined by the new version of the class only when the old and new versions of the class define the same data elements as determined by comparing the first and second layouts of data elements; and creating a new object instance from the new version of the class and transferring one or more values of one or more of the data elements from the selected old object instance to the new object instance only when the old and new versions of the class do not define the same data elements as determined by comparing the first and second layouts of data elements.