Method for garbage collection of unused methods
Abstract
The present invention provides a system and a method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many methods, i.e. program sections, that are stored in the memory of the computer used, and where garbage collecting is used by said program, wherein the method is characterized by a first step in which all thread stacks are analyzed with respect to methods required thereby; a second step in which each of the methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated methods prior to the regeneration of a method; and by a third step in which all non-regenerated methods are erased, wherein the corresponding memory space is placed at the disposal of said program.
Claims
exact text as granted — not AI-modified1 . A method of optimizing distribution of software methods within a memory space of a virtual machine, comprising the steps of:
determining, within a plurality of methods originally distributed within a memory space of a virtual machine, a selection of the plurality of methods to be regenerated, wherein the step of determining includes stopping each running thread and, while the thread is stopped, determining methods in the stopped thread that are currently required by applications running on the virtual machine; creating regenerated methods corresponding to the methods currently required by applications running on the virtual machine; replacing references to each method in the original selection with references to the regenerated method; restarting the stopped thread; and erasing any other methods that have not been regenerated.
2 . The method of claim 1 , wherein the step of analyzing threads includes analyzing thread stacks to determine the methods currently required by the threads.
3 . The method of claim 1 , wherein the step of creating regenerated methods includes stopping the threads and recreating at an alternate memory address a copy of the methods required by the threads.
4 . The method of claim 1 , wherein the step of erasing includes releasing the portion of memory space occupied by the non-regenerated methods.
5 . The method of claim 1 , wherein the step of determining includes determining an optimal locking mechanism to be used with the selection of methods.
6 . The method of claim 1 , wherein the step of erasing includes using a stop and copy method of garbage collection.
7 . The method of claim 1 , wherein the step of restarting the stopped thread takes place before the step of erasing any other methods that have not been regenerated.
8 . The method of claim 1 , wherein the step of restarting the stopped thread takes place after the step of erasing any other methods that have not been regenerated.
9 . A system for optimizing distribution of software methods within a memory space of a virtual machine, comprising:
a virtual machine having a memory space and methods stored therein; and a garbage collector that
determines, within a plurality of methods originally distributed within a memory space of a virtual machine, a selection of the plurality of methods to be regenerated, wherein the garbage collector stops each running thread and, while the thread is stopped, determines methods in the stopped thread that are currently required by applications running on the virtual machine,
creates regenerated methods corresponding to the methods currently required by applications running on the virtual machine,
replaces references to each method in the original selection with references to the regenerated method,
restarts the stopped thread, and
erases any other methods that have not been regenerated.
10 . The system of claim 9 , wherein the step of determining the methods currently required includes analyzing thread stacks to determine the methods currently required by threads.
11 . The system of claim 9 , wherein the step of creating regenerated methods includes stopping the threads and recreating at an alternate memory address a copy of the methods required by the threads.
12 . The system of claim 9 , wherein the step of erasing includes releasing the portion of memory space occupied by the non-regenerated methods.
13 . The system of claim 9 , wherein the step of determining includes determining an optimal locking mechanism to be used with the selection of methods.
14 . The system of claim 9 , wherein the step of erasing includes using a stop and copy method of garbage collection.
15 . The system of claim 9 , wherein the step of restarting the stopped thread takes place before the step of erasing any other methods that have not been regenerated.
16 . The system of claim 9 , wherein the step of restarting the stopped thread takes place after the step of erasing any other methods that have not been regenerated.
17 . A computer readable medium including instructions stored therein which when executed by a computer causes the computer to perform the steps of:
determining, within a plurality of methods originally distributed within a memory space of a virtual machine, a selection of the plurality of methods to be regenerated, wherein the step of determining includes stopping each running thread and, while the thread is stopped, determining methods in the stopped thread that are currently required by applications running on the virtual machine; creating regenerated methods corresponding to the methods currently required by applications running on the virtual machine; replacing references to each method in the original selection with references to the regenerated method; restarting the stopped thread; and erasing any other methods that have not been regenerated.
18 . The computer readable medium of claim 17 , wherein the step of restarting the stopped thread takes place before the step of erasing any other methods that have not been regenerated.
19 . The computer readable medium of claim 17 , wherein the step of restarting the stopped thread takes place after the step of erasing any other methods that have not been regenerated.Join the waitlist — get patent alerts
Track US2007073794A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.