Patent ID: 7194494

Claim:
A process for optimizing the distribution of application methods within the memory space of a computer system or virtual machine, wherein the application methods are part of an application program and wherein the computer system or virtual machine includes a plurality of threads, comprising the steps of: analyzing thread stacks to determine a selection of application methods by stopping each thread one at a time, determining a selection of application methods currently required by the stopped thread, and restarting the stopped thread; creating regenerated application methods by copying the selection of application methods to new memory addresses, determining if any of the application methods reference any of the selection of application methods, and replacing each reference by an application method to one of the selection of application methods, with a corresponding reference to the new memory address of the one of the selection of application methods; and erasing all non-regenerated application methods and releasing the memory space occupied by those non-regenerated application methods, for subsequent use by the application program.