US20070073794A1 - Method for garbage collection of unused methods - Google Patents

Method for garbage collection of unused methods Download PDF

Info

Publication number
US20070073794A1
US20070073794A1 US11/586,192 US58619206A US2007073794A1 US 20070073794 A1 US20070073794 A1 US 20070073794A1 US 58619206 A US58619206 A US 58619206A US 2007073794 A1 US2007073794 A1 US 2007073794A1
Authority
US
United States
Prior art keywords
methods
regenerated
thread
virtual machine
stopped
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Abandoned
Application number
US11/586,192
Inventor
Joakim Dahlstedt
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEA Systems Inc
Original Assignee
BEA Systems Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEA Systems Inc filed Critical BEA Systems Inc
Priority to US11/586,192 priority Critical patent/US20070073794A1/en
Publication of US20070073794A1 publication Critical patent/US20070073794A1/en
Abandoned legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99951File or database maintenance
    • Y10S707/99956File allocation
    • Y10S707/99957Garbage collection

Definitions

  • the invention relates to a method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application methods.
  • JAVA also includes methods for so called thread management tools.
  • JAVA incorporates a system for supporting or simulating the simultaneous processing of two or more programs.
  • the thread management can be divided into two parts. One part concerns the manner in which different threads are structured in a controlled manner. Another part is concerned with which threads shall be run and which threads shall be passive and wait to be run.
  • the present invention relates to a system and method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application 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 inventive method is characterized by a first step in which all so-called thread stacks are analyzed with respect to application methods required thereby; a second step in which each of the application methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated application methods prior to the regeneration of a method; and by a third step in which all non-regenerated application methods are erased, wherein the corresponding memory space is placed at the disposal of said program.
  • the inventive method is characterized by a first step in which all so-called thread stacks are analyzed with respect to application methods required thereby; a second step in which each of the application methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated application methods prior to the
  • the invention is concerned with increasing the data processing rate in virtual machines, and then particularly with respect to the JAVA program language.
  • the invention is not restricted to JAVA, but can be applied with many program languages, although the invention is described below primarily with reference to JAVA.
  • the system and methods provided by the invention are intended for use with adaptive optimization of a program.
  • adaptive optimization the program is restructured and different parts of the program are optimized as the program is run.
  • the general problem of increasing data processing capacity resides in the rapid creation of new memory sites, since the longer the program is run, the more memory space is required.
  • the invention comprises a process for optimizing the distribution of application methods within the memory space of a computer system or virtual machine, comprising the steps of: determining a selection of application methods to be regenerated; creating regenerated application methods, and replacing references to each method with references to the regenerated method; and, erasing all non-regenerated application methods and releasing the memory space occupied by those non-regenerated application methods.
  • the above step of determining includes analyzing thread stacks associated with each method.
  • FIG. 1 is a block diagram showing the placement of a JAVA virtual machine in a typical environment.
  • FIG. 2 illustrates an example of application methods prior to regeneration.
  • FIG. 3 illustrates application methods regenerated in accordance with the invention.
  • JAVA and other dynamic program languages include an automatic memory management.
  • the virtual machine carries out a so-called garbage collection from time to time, meaning, in principle, that the virtual machine scans the entire memory and finds which objects have been stored in the memory and which the program can no longer address. These parts of the memory are returned for later use.
  • JAVA also includes methods for so called thread management tools. In such a system, threads form the core technology upon which applications execute and communicate with the server.
  • JAVA incorporates a system for supporting or simulating the simultaneous processing of two or more programs.
  • the present invention thus relates to a method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application methods, i.e. program sections, that are stored in the memory of the computer used, and where garbage collecting is used by said program.
  • the method is characterized by a first step in which all so-called thread stacks are analyzed with respect to application methods required thereby; a second step in which each of the application methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated application methods prior to the regeneration of a method; and by a third step in which all non-regenerated application methods are erased, wherein the corresponding memory space is placed at the disposal of said program.
  • JAVATM, Java Virtual MachineTM, JVMTM and SolarisTM are trademarks of Sun Microsystems, Inc.
  • the terms WindowsTM, Windows NT, and WinNTTM are trademarks of Microsoft Corporation.
  • the term LINUXTM is a trademark of Linus Torvalds.
  • FIG. 1 shows that a JAVA virtual machine (JVM) 102 can be used to run different data programs 1 , 2 , 3 (indicated as 104 , 106 , 108 , respectively), regardless of whether the operative system is, for example, WinNT 110 , Linux 112 , Solaris 114 or some other type of system.
  • JVM JAVA virtual machine
  • FIG. 1 shows that a JAVA virtual machine (JVM) 102 can be used to run different data programs 1 , 2 , 3 (indicated as 104 , 106 , 108 , respectively), regardless of whether the operative system is, for example, WinNT 110 , Linux 112 , Solaris 114 or some other type of system.
  • JVM JAVA virtual machine
  • the present invention thus relates to a system and method of improving the effectiveness of a data processing application when using a virtual machine, wherein the program includes a large number of application methods, i.e. program sections, that are stored in the memory of the computer used, and wherein a garbage collecting process is used by the program.
  • the program includes a large number of application methods, i.e. program sections, that are stored in the memory of the computer used, and wherein a garbage collecting process is used by the program.
  • the invention first identifies application methods to be regenerated.
  • all so called thread stacks are analyzed with respect to the application methods required, in a first step of the inventive method.
  • each of the application methods required is regenerated, where occurrent references to a method are replaced with references to regenerated application methods prior to said regeneration.
  • all non-regenerated application methods are erased and the corresponding memory space placed at the disposal of the program.
  • This procedure does not only clean out unused application methods, but also results in a reorganization between those application methods that have been regenerated, so as to direct any references to the original application methods immediately to appropriate regenerated application methods instead of proceeding via an old method that is no longer used.
  • FIGS. 2 and 3 This is illustrated in the example of FIGS. 2 and 3 , in which example application methods foo and bar are used for illustration. It will be evident to one skilled in the art that the JAVA-based foo and bar application methods shown in FIGS. 2 and 3 are given for purposes of illustrating the regeneration and garbage collection features of the invention, and that the invention is not limited solely to the types of application methods herein, but can be used with a wide variety of method-based systems.
  • FIG. 2 illustrates the old or original application methods
  • FIG. 3 illustrates the regenerated application methods.
  • Three application methods foo 116 , apa 118 and bar 120 are shown in FIG. 2 .
  • the foo method 116 starts at the memory address 4711 .
  • the apa method 118 starts at the address 4714
  • bar method 120 starts at the address 4720 .
  • FIG. 3 illustrates how the application methods foo and bar are regenerated to provide new application methods.
  • the new application methods foo 122 and bar 124 are recreated precisely to match their original predecessors, although with the difference that the new application methods obtain new addresses.
  • the foo reference to bar now points to the new bar address 4903 .
  • Such a method can be used when applying the present invention.
  • one thread is stopped at a time whilst the program is running, wherewith application methods used for a stopped thread are selectively transferred to a list and the thread then restarted.
  • the application methods in the list are then regenerated and stored. All threads are later caused to be stopped at the same time, subsequent to having treated all threads this way, namely so that all used application methods relating to the threads concerned have been regenerated. All application methods that have not been regenerated are erased and all threads are restarted with the regenerated application methods.
  • This method obviates the need to stop running the program, since the regeneration takes place intermittently.
  • lock mechanisms are used in JAVA and corresponding languages. Different lock mechanisms can be selected. The important thing is to select the lock mechanism that is the most effective in preventing more than one thread having access to a given object at the same time as another thread.
  • each thread endeavors to reach the source lock.
  • the source lock mechanism can be used in various ways. The effectiveness of different lock mechanisms will depend on how threads endeavor to obtain access to synchronized sources.
  • the most effective locking mechanisms are identified in a step prior to said first step, and the application methods that use a thus identified locking mechanism are regenerated.
  • garbage collecting algorithms With respect for garbage collecting algorithms, these also need to be selected. Many object oriented languages use garbage collection. This means that the programmer need not instruct the system explicitly that a certain object is no longer required. The system is responsible for this detection, and reclaims the part of the memory occupied by the object. A number of different algorithms have been proposed for effective implementation of this detection and reclaim. It has been found that different algorithms are best for different applications. The choice of the best garbage collecting algorithm for the program application being run is highly significant in achieving maximum execution rate in respect of the program concerned.
  • the allocation and length of life of the various objects are determined in a step prior to said first method step, whereafter the most effective garbage collecting algorithm is caused to be identified and application methods that constituting the requisite garbage collecting algorithms are regenerated and remaining garbage collecting algorithms then erased.
  • Application of the preferred embodiments provides a highly effective method for optimizing codes, threads and memory management, where a generic feature resides in the identification and regeneration of application methods so as to not load the system with unused application 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.

Description

    CROSS REFERENCE TO RELATED APPLICAITONS
  • This application is a continuation application of U.S. patent application Ser. No. 10/111,566 entitled METHOD FOR GARBAGE COLLECTION OF UNUSED METHODS, filed on Oct. 31, 2002 (Attorney Docket No. BEAS-01246US2) which claims priority from PCT application PCT/SE00/02096, filed Oct. 27, 2000 which claims priority to Sweden Application No. 9903890-3 filed Oct. 28, 1999, and incorporated herein by reference.
  • COPYRIGHT NOTICE
  • A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
  • FIELD OF THE INVENTION
  • The invention relates to a method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application methods.
  • BACKGROUND
  • In a computer system, the ability to control the allocation of memory resources is vital to the successful operation and scalability of the computer system as a whole. Software applications run more efficiently in environments in which steps are taken to proactively manage available memory resources to ensure that only those entities that are currently being used are stored in memory, while little-used entities are cleanly removed. Such memory management techniques have commonly been applied to object management, including the JAVA language, and other object-oriented environments. Many memory management techniques can be designed to be automatic, or to allow a developer control over the allocation. JAVA and other dynamic program languages include an automatic memory management. This means that the programmer need not keep an account of those parts of the memory that are used. The virtual machine carries out a so-called garbage collection from time to time, meaning, in principle, that the virtual machine scans the entire memory and finds which objects have been stored in the memory and which objects the program can no longer address. These parts of the memory are returned for later use.
  • JAVA also includes methods for so called thread management tools. Thus, JAVA incorporates a system for supporting or simulating the simultaneous processing of two or more programs. The thread management can be divided into two parts. One part concerns the manner in which different threads are structured in a controlled manner. Another part is concerned with which threads shall be run and which threads shall be passive and wait to be run.
  • However, in order to further increase effectiveness and place occupied memory space at the disposal of the program, it is not sufficient to solely optimize the memory with respect to the objects. Additional mechanisms are required when the program includes many application methods, to better optimize the arrangement of application methods within the memory space.
  • SUMMARY OF THE INVENTION
  • The present invention relates to a system and method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application 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 inventive method is characterized by a first step in which all so-called thread stacks are analyzed with respect to application methods required thereby; a second step in which each of the application methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated application methods prior to the regeneration of a method; and by a third step in which all non-regenerated application methods are erased, wherein the corresponding memory space is placed at the disposal of said program.
  • More specifically, the invention is concerned with increasing the data processing rate in virtual machines, and then particularly with respect to the JAVA program language.
  • The invention is not restricted to JAVA, but can be applied with many program languages, although the invention is described below primarily with reference to JAVA.
  • The system and methods provided by the invention are intended for use with adaptive optimization of a program. In adaptive optimization, the program is restructured and different parts of the program are optimized as the program is run. The general problem of increasing data processing capacity resides in the rapid creation of new memory sites, since the longer the program is run, the more memory space is required.
  • In one embodiment the invention comprises a process for optimizing the distribution of application methods within the memory space of a computer system or virtual machine, comprising the steps of: determining a selection of application methods to be regenerated; creating regenerated application methods, and replacing references to each method with references to the regenerated method; and, erasing all non-regenerated application methods and releasing the memory space occupied by those non-regenerated application methods. The above step of determining includes analyzing thread stacks associated with each method.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • FIG. 1 is a block diagram showing the placement of a JAVA virtual machine in a typical environment.
  • FIG. 2 illustrates an example of application methods prior to regeneration.
  • FIG. 3 illustrates application methods regenerated in accordance with the invention.
  • DETAILED DESCRIPTION
  • As described above, JAVA and other dynamic program languages include an automatic memory management. The virtual machine carries out a so-called garbage collection from time to time, meaning, in principle, that the virtual machine scans the entire memory and finds which objects have been stored in the memory and which the program can no longer address. These parts of the memory are returned for later use. JAVA also includes methods for so called thread management tools. In such a system, threads form the core technology upon which applications execute and communicate with the server. Thus, JAVA incorporates a system for supporting or simulating the simultaneous processing of two or more programs.
  • However, in order to further increase effectiveness and place occupied memory space at the disposal of the program, it is not sufficient to solely optimize the memory with respect to the objects. Additional mechanisms are required when the program includes many application methods, to better optimize the arrangement of application methods within the memory space. The present invention solves this problem.
  • The present invention thus relates to a method of improving the effectiveness of a data processing application when using a virtual machine, where the program includes many application methods, i.e. program sections, that are stored in the memory of the computer used, and where garbage collecting is used by said program. In one embodiment, the method is characterized by a first step in which all so-called thread stacks are analyzed with respect to application methods required thereby; a second step in which each of the application methods required is caused to be regenerated where occurrent references to a method are replaced with reference to regenerated application methods prior to the regeneration of a method; and by a third step in which all non-regenerated application methods are erased, wherein the corresponding memory space is placed at the disposal of said program.
  • As used herein the JAVA™, Java Virtual Machine™, JVM™ and Solaris™ are trademarks of Sun Microsystems, Inc. The terms Windows™, Windows NT, and WinNT™ are trademarks of Microsoft Corporation. The term LINUX™ is a trademark of Linus Torvalds.
  • The present invention will now be described in more detail partly with reference to an exemplifying embodiment of the invention shown on to the accompanying drawing in which like numerals represent features common among the drawings.
  • FIG. 1 shows that a JAVA virtual machine (JVM) 102 can be used to run different data programs 1, 2, 3 (indicated as 104, 106, 108, respectively), regardless of whether the operative system is, for example, WinNT 110, Linux 112, Solaris 114 or some other type of system. As mentioned above, although JAVA is a very popular program language, the present invention is not restricted to this language but can be applied to all object-oriented and platform-independent corresponding program languages.
  • The present invention thus relates to a system and method of improving the effectiveness of a data processing application when using a virtual machine, wherein the program includes a large number of application methods, i.e. program sections, that are stored in the memory of the computer used, and wherein a garbage collecting process is used by the program.
  • It is previously known to garbage collect objects and therewith erase objects that are no longer in current use by thereby placing corresponding memory capacity at the disposal of the system.
  • In large systems, many methods, i.e. program sections, are used one or a few times, or methods are applied for a short period of time and then left unused.
  • In the case of JAVA and corresponding programs, new application methods are loaded and old application methods left unused.
  • Furthermore, adaptive optimization results in the optimization and re-optimization of methods placed in the memory, where old application methods are left unused.
  • When optimizing lock mechanism selections and garbage collection selection, it is necessary to replace all used application methods that use old mechanisms with new mechanisms.
  • Generally described, the invention first identifies application methods to be regenerated. According to an embodiment of the invention, all so called thread stacks are analyzed with respect to the application methods required, in a first step of the inventive method. In a second step, each of the application methods required is regenerated, where occurrent references to a method are replaced with references to regenerated application methods prior to said regeneration. In a third step, all non-regenerated application methods are erased and the corresponding memory space placed at the disposal of the program.
  • This procedure does not only clean out unused application methods, but also results in a reorganization between those application methods that have been regenerated, so as to direct any references to the original application methods immediately to appropriate regenerated application methods instead of proceeding via an old method that is no longer used.
  • This is illustrated in the example of FIGS. 2 and 3, in which example application methods foo and bar are used for illustration. It will be evident to one skilled in the art that the JAVA-based foo and bar application methods shown in FIGS. 2 and 3 are given for purposes of illustrating the regeneration and garbage collection features of the invention, and that the invention is not limited solely to the types of application methods herein, but can be used with a wide variety of method-based systems.
  • FIG. 2 illustrates the old or original application methods, and FIG. 3 illustrates the regenerated application methods. Three application methods foo 116, apa 118 and bar 120 are shown in FIG. 2. In the example shown, the foo method 116 starts at the memory address 4711. The apa method 118 starts at the address 4714, and bar method 120 starts at the address 4720.
  • In this example, analysis of the thread stacks shows that only the application methods foo and bar are used and consequently foo and bar have not been referenced to the method apa.
  • FIG. 3 illustrates how the application methods foo and bar are regenerated to provide new application methods. In the example illustrated in FIG. 3, the new application methods foo 122 and bar 124 are recreated precisely to match their original predecessors, although with the difference that the new application methods obtain new addresses. In the example shown, the foo reference to bar now points to the new bar address 4903.
  • All of the old application methods, i.e. the application methods foo 116, apa 118 and bar 120 shown in FIG. 2, can now be erased and the memory spaces previously occupied by these application methods vacated for further use.
  • When garbage collection of objects takes place, running the program normally stops while garbage collection takes place. Running of the program is restarted subsequent to the garbage collection and to the erasure of objects that are not in use.
  • Such a method can be used when applying the present invention.
  • However, the following method is preferable.
  • When practicing the inventive method, one thread is stopped at a time whilst the program is running, wherewith application methods used for a stopped thread are selectively transferred to a list and the thread then restarted. The application methods in the list are then regenerated and stored. All threads are later caused to be stopped at the same time, subsequent to having treated all threads this way, namely so that all used application methods relating to the threads concerned have been regenerated. All application methods that have not been regenerated are erased and all threads are restarted with the regenerated application methods.
  • This method obviates the need to stop running the program, since the regeneration takes place intermittently.
  • As before mentioned, lock mechanisms are used in JAVA and corresponding languages. Different lock mechanisms can be selected. The important thing is to select the lock mechanism that is the most effective in preventing more than one thread having access to a given object at the same time as another thread.
  • A synchronization problem exists when several threads desire access to one and the same object or source. In order to solve this problem in JAVA, each thread endeavors to reach the source lock. The source lock mechanism can be used in various ways. The effectiveness of different lock mechanisms will depend on how threads endeavor to obtain access to synchronized sources.
  • According to a preferred embodiment, when locking mechanisms are used the most effective locking mechanisms are identified in a step prior to said first step, and the application methods that use a thus identified locking mechanism are regenerated.
  • With respect for garbage collecting algorithms, these also need to be selected. Many object oriented languages use garbage collection. This means that the programmer need not instruct the system explicitly that a certain object is no longer required. The system is responsible for this detection, and reclaims the part of the memory occupied by the object. A number of different algorithms have been proposed for effective implementation of this detection and reclaim. It has been found that different algorithms are best for different applications. The choice of the best garbage collecting algorithm for the program application being run is highly significant in achieving maximum execution rate in respect of the program concerned.
  • According to another preferred embodiment of the invention, when different garbage collecting algorithms are used the allocation and length of life of the various objects are determined in a step prior to said first method step, whereafter the most effective garbage collecting algorithm is caused to be identified and application methods that constituting the requisite garbage collecting algorithms are regenerated and remaining garbage collecting algorithms then erased.
  • Application of the preferred embodiments provides a highly effective method for optimizing codes, threads and memory management, where a generic feature resides in the identification and regeneration of application methods so as to not load the system with unused application methods.
  • The foregoing description of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the art to understand the invention for various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalence.

Claims (19)

1. 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.
US11/586,192 1999-10-28 2006-10-25 Method for garbage collection of unused methods Abandoned US20070073794A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US11/586,192 US20070073794A1 (en) 1999-10-28 2006-10-25 Method for garbage collection of unused methods

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
SE9903890A SE514318C2 (en) 1999-10-28 1999-10-28 Process for streamlining a data processing process using a virtual machine and using a garbage collection procedure
SE9903890-3 1999-10-28
US10/111,566 US7194494B1 (en) 1999-10-28 2000-10-27 Method for garbage collection of unused methods
PCT/SE2000/002096 WO2001031455A1 (en) 1999-10-28 2000-10-27 A method for garbage collection of unused methods
US11/586,192 US20070073794A1 (en) 1999-10-28 2006-10-25 Method for garbage collection of unused methods

Related Parent Applications (2)

Application Number Title Priority Date Filing Date
PCT/SE2000/002096 Continuation WO2001031455A1 (en) 1999-10-28 2000-10-27 A method for garbage collection of unused methods
US11156602A Continuation 1999-10-28 2002-04-26

Publications (1)

Publication Number Publication Date
US20070073794A1 true US20070073794A1 (en) 2007-03-29

Family

ID=20417516

Family Applications (2)

Application Number Title Priority Date Filing Date
US10/111,566 Expired - Lifetime US7194494B1 (en) 1999-10-28 2000-10-27 Method for garbage collection of unused methods
US11/586,192 Abandoned US20070073794A1 (en) 1999-10-28 2006-10-25 Method for garbage collection of unused methods

Family Applications Before (1)

Application Number Title Priority Date Filing Date
US10/111,566 Expired - Lifetime US7194494B1 (en) 1999-10-28 2000-10-27 Method for garbage collection of unused methods

Country Status (11)

Country Link
US (2) US7194494B1 (en)
EP (1) EP1240589B1 (en)
JP (1) JP4150518B2 (en)
KR (1) KR20020070270A (en)
CN (1) CN100382047C (en)
AT (1) ATE402443T1 (en)
AU (1) AU768181B2 (en)
CA (1) CA2389168C (en)
DE (1) DE60039628D1 (en)
SE (1) SE514318C2 (en)
WO (1) WO2001031455A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110246543A1 (en) * 2010-04-01 2011-10-06 International Business Machines Corporation Write Barrier Elision for Reference Arrays

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005018425A (en) * 2003-06-26 2005-01-20 Matsushita Electric Ind Co Ltd Program conversion method, program and storage medium
ATE479942T1 (en) * 2003-06-30 2010-09-15 Panasonic Corp MEMORY CLEANUP SYSTEM
EP1622009A1 (en) * 2004-07-27 2006-02-01 Texas Instruments Incorporated JSM architecture and systems
DE102007026693A1 (en) 2007-06-08 2008-12-11 Robert Bosch Gmbh Method and device for reorganizing data in a storage system, in particular for control devices in motor vehicles
US10606614B2 (en) * 2016-07-31 2020-03-31 Oracle International Corporation Container-based language runtime using a variable-sized container for an isolated method
CN114265670B (en) * 2022-03-02 2022-09-23 阿里云计算有限公司 Memory block sorting method, medium and computing device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5088036A (en) * 1989-01-17 1992-02-11 Digital Equipment Corporation Real time, concurrent garbage collection system and method
US5355483A (en) * 1991-07-18 1994-10-11 Next Computers Asynchronous garbage collection
US5652883A (en) * 1992-06-15 1997-07-29 Microsoft Corporation Computer method and system for conservative-stack and generational heap garbage collection
US5692193A (en) * 1994-03-31 1997-11-25 Nec Research Institute, Inc. Software architecture for control of highly parallel computer systems
US5915255A (en) * 1997-04-23 1999-06-22 Sun Microsystems, Inc. Method and apparatus for referencing nodes using links
US6041179A (en) * 1996-10-03 2000-03-21 International Business Machines Corporation Object oriented dispatch optimization
US6463581B1 (en) * 1996-10-03 2002-10-08 International Business Machines Corporation Method for determining reachable methods in object-oriented applications that use class libraries
US6654951B1 (en) * 1998-12-14 2003-11-25 International Business Machines Corporation Removal of unreachable methods in object-oriented applications based on program interface analysis

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4797810A (en) * 1986-06-26 1989-01-10 Texas Instruments Incorporated Incremental, multi-area, generational, copying garbage collector for use in a virtual address space
US5293614A (en) * 1991-04-08 1994-03-08 Texas Instruments Incorporated System and method for hard real-time garbage collection requiring a write barrier but no read barrier
US5873105A (en) * 1997-06-26 1999-02-16 Sun Microsystems, Inc. Bounded-pause time garbage collection system and method including write barrier associated with a source instance of a partially relocated object
WO1999032978A1 (en) * 1997-12-19 1999-07-01 Microsoft Corporation Incremental garbage collection

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5088036A (en) * 1989-01-17 1992-02-11 Digital Equipment Corporation Real time, concurrent garbage collection system and method
US5355483A (en) * 1991-07-18 1994-10-11 Next Computers Asynchronous garbage collection
US5652883A (en) * 1992-06-15 1997-07-29 Microsoft Corporation Computer method and system for conservative-stack and generational heap garbage collection
US5692193A (en) * 1994-03-31 1997-11-25 Nec Research Institute, Inc. Software architecture for control of highly parallel computer systems
US6041179A (en) * 1996-10-03 2000-03-21 International Business Machines Corporation Object oriented dispatch optimization
US6463581B1 (en) * 1996-10-03 2002-10-08 International Business Machines Corporation Method for determining reachable methods in object-oriented applications that use class libraries
US5915255A (en) * 1997-04-23 1999-06-22 Sun Microsystems, Inc. Method and apparatus for referencing nodes using links
US6654951B1 (en) * 1998-12-14 2003-11-25 International Business Machines Corporation Removal of unreachable methods in object-oriented applications based on program interface analysis

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110246543A1 (en) * 2010-04-01 2011-10-06 International Business Machines Corporation Write Barrier Elision for Reference Arrays
US8943109B2 (en) * 2010-04-01 2015-01-27 International Business Machines Corporation Write barrier elision for reference arrays

Also Published As

Publication number Publication date
EP1240589B1 (en) 2008-07-23
WO2001031455A1 (en) 2001-05-03
DE60039628D1 (en) 2008-09-04
CN100382047C (en) 2008-04-16
SE9903890L (en) 2001-02-12
CA2389168C (en) 2009-10-06
JP2003513356A (en) 2003-04-08
CN1402847A (en) 2003-03-12
AU1563201A (en) 2001-05-08
US7194494B1 (en) 2007-03-20
AU768181B2 (en) 2003-12-04
ATE402443T1 (en) 2008-08-15
SE514318C2 (en) 2001-02-12
EP1240589A1 (en) 2002-09-18
CA2389168A1 (en) 2001-05-03
SE9903890D0 (en) 1999-10-28
JP4150518B2 (en) 2008-09-17
KR20020070270A (en) 2002-09-05

Similar Documents

Publication Publication Date Title
US7650370B2 (en) System and method for regeneration of methods and garbage collection of unused methods
US8245239B2 (en) Deterministic runtime execution environment and method
KR100541174B1 (en) Data processor with localised memory reclamation
US7962707B2 (en) Apparatus and method for deterministic garbage collection of a heap memory
EP0881576B1 (en) Method and apparatus for generational garbage collection in a shared heap memory by means of multiple processor units
US6816956B1 (en) User control of multiple memory heaps
US20070073794A1 (en) Method for garbage collection of unused methods
US7024436B2 (en) Computer system with two heaps in contiguous storage
US7263700B1 (en) Serially, reusable virtual machine
KR100289628B1 (en) Resource management method and apparatus for information processing system of multitasking facility
EP1560119B1 (en) Method and apparatus for adaptive garbage collection
US6557091B2 (en) Data processor with localized memory reclamation
US7107426B2 (en) Computer system with heap reset for performing generational garbage collection implemented by card-marking between successive applications
US6493730B1 (en) Efficient object faulting with generational garbage collection
US6804765B2 (en) Computer system with multiple heaps
US20020087589A1 (en) Methods and apparatus for optimizing garbage collection
JP2001034532A (en) Method and system for detecting and uniting idle areas during collection of garbage
US8478738B2 (en) Object deallocation system and method
US6427154B1 (en) Method of delaying space allocation for parallel copying garbage collection
US5678024A (en) Method and system for dynamic performance resource management within a computer based system
US20090228537A1 (en) Object Allocation System and Method
US6842838B2 (en) Preemptive memory-block splitting

Legal Events

Date Code Title Description
STCB Information on status: application discontinuation

Free format text: ABANDONED -- FAILURE TO RESPOND TO AN OFFICE ACTION