Adaptive dynamic code unloading method

Min Yang,Bo Zhou,Yuan Zhang
2011-01-01
Abstract:The invention belongs to the technical field of Java virtual machine design, in particular to an adaptive dynamic code unloading method. The method comprises the following steps of: traversing a method stack, acquiring stack frame data of each method from a virtual machine stack; transferring method state, namely carrying out correct method unloading state transferring according to a designed state machine and obtained method stack information; unloading code, namely traversing the whole method list by the virtual machine to acquire unloading state of each method, if the state meets a stop state set by the state machine, unloading the code of the method and releasing the internal memory occupied by the code of the method. In the invention, by virtue of the traditional garbage recycling mechanism, the state of the method is dynamically acquired in a garbage recycling process, method is adaptively unloaded according to custom settings, overhead for resolving a program to obtain a more accurate hot and cold method is eliminated, program execution speed is improved, and better code unloading effect is obtained.
What problem does this paper attempt to address?