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

Method for garbage collection of unused methods Download PDF

Info

Publication number
US7194494B1
US7194494B1 US10/111,566 US11156600A US7194494B1 US 7194494 B1 US7194494 B1 US 7194494B1 US 11156600 A US11156600 A US 11156600A US 7194494 B1 US7194494 B1 US 7194494B1
Authority
US
United States
Prior art keywords
application methods
garbage collecting
regenerated
application
thread
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.)
Expired - Lifetime, expires
Application number
US10/111,566
Other languages
English (en)
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.)
Oracle International Corp
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
Assigned to BEA SYSTEMS, INC. reassignment BEA SYSTEMS, INC. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BEA SYSTEMS STOCKHOLM ENGINEERING AB
Assigned to BEA SYSTEMS STOCKHOLM ENGINEERING AB reassignment BEA SYSTEMS STOCKHOLM ENGINEERING AB ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: DAHLSTEDT, JOAKIM
Priority to US11/586,192 priority Critical patent/US20070073794A1/en
Application granted granted Critical
Publication of US7194494B1 publication Critical patent/US7194494B1/en
Assigned to ORACLE INTERNATIONAL CORPORATION reassignment ORACLE INTERNATIONAL CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: BEA SYSTEMS, INC.
Adjusted expiration legal-status Critical
Expired - Lifetime 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 present invention relates to a method of improving the effectiveness of a data processing application.
  • 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 method is intended for use with adaptive optimisation of a program.
  • adaptive optimisation the program is restructured and different parts of the program are optimised 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.
  • JAVA and other dynamic program language 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 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 methods.
  • 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 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, wherein the inventive method is characterised by a first step in which all so-called thread stacks are analysed 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 an application method are replaced with reference to regenerated application methods prior to the regeneration of an application 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 characterised by a first step in which all so-called thread stacks are analysed 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 an application method are replaced with reference to regenerated application methods prior to the regeneration
  • FIG. 1 is a block diagram
  • FIG. 2 illustrates old application methods
  • FIG. 3 illustrates application methods regenerated in accordance with the invention.
  • FIG. 1 shows that a JAVA virtual machine, JVM, can be used to run different data programs 1 , 2 , 3 , regardless of whether the operative system is WinNT, LINUX, Solaris or some other system.
  • JVM JAVA virtual machine
  • FIG. 1 shows that a JAVA virtual machine, JVM, can be used to run different data programs 1 , 2 , 3 , regardless of whether the operative system is WinNT, LINUX, Solaris or some other system.
  • JAVA is a very popular program language
  • the present invention is not restricted to this language but can be applied to all object-orientated and platform-independent corresponding program languages.
  • the present invention thus relates to a 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.
  • all so called thread stacks are analysed 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 application 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 references of the application methods immediately to a regenerated application method instead of proceeding via an old application method that is no longer used.
  • FIGS. 2 and 3 illustrates old application methods and FIG. 3 illustrates used regenerated application methods.
  • FIG. 2 illustrates old application methods
  • FIG. 3 illustrates used regenerated application methods.
  • Three application methods foo, apa and bar are shown in FIG. 2 .
  • Foo starts on the memory address 4711 .
  • Apa starts on the address 4714 and bar starts on the address 4720 .
  • the application method foo and bar are regenerated to those application methods illustrated in FIG. 3 .
  • the application methods foo and bar are recreated precisely, although with the difference that the application methods obtain new addresses and that then the foo reference to bar 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 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 in 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.
  • the source look mechanism can be used in various ways. The effectiveness of different lock mechanisms will depend on how threads endeavour to obtain access to synchronised sources.
  • the most effective locking mechanisms are identified in a step prior to said first step, and the methods that use a thus identified locking mechanism are regenerated.
  • garbage collecting algorithms With respect to garbage collecting algorithms, these also need to be selected. Many object orientated 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 the application methods 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 optimising 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)
  • Processing Of Solid Wastes (AREA)
  • Devices For Executing Special Programs (AREA)
  • Electrotherapy Devices (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
US10/111,566 1999-10-28 2000-10-27 Method for garbage collection of unused methods Expired - Lifetime US7194494B1 (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 (2)

Application Number Priority Date Filing Date Title
SE9903890A SE514318C2 (sv) 1999-10-28 1999-10-28 Förfarande för att effektivisera en databehandlingsprocess vid användning av en virtuell maskin och där ett skräpsamlingsförfarande används
PCT/SE2000/002096 WO2001031455A1 (en) 1999-10-28 2000-10-27 A method for garbage collection of unused methods

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
PCT/SE2000/002096 A-371-Of-International WO2001031455A1 (en) 1999-10-28 2000-10-27 A method for garbage collection of unused methods

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US10/162,308 Continuation-In-Part US6970893B2 (en) 1999-10-28 2002-06-04 System and method for regeneration of methods and garbage collection of unused methods

Publications (1)

Publication Number Publication Date
US7194494B1 true US7194494B1 (en) 2007-03-20

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 After (1)

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

Country Status (11)

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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040268323A1 (en) * 2003-06-26 2004-12-30 Matsushita Electric Industrial Co., Ltd Program converting method, program and storage medium
US20060026183A1 (en) * 2004-07-27 2006-02-02 Texas Instruments Incorporated Method and system provide concurrent access to a software object
US20180032347A1 (en) * 2016-07-31 2018-02-01 Oracle International Corporation Container-based language runtime using a variable-sized container for an isolated method

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4569926B2 (ja) * 2003-06-30 2010-10-27 パナソニック株式会社 ガーベジコレクションシステム
DE102007026693A1 (de) 2007-06-08 2008-12-11 Robert Bosch Gmbh Verfahren und Vorrichtung zum Umorganisieren von Daten in einem Speichersystem, insbesondere für Steuergeräte in Kraftfahrzeugen
CA2700217C (en) * 2010-04-01 2011-07-19 Ibm Canada Limited - Ibm Canada Limitee Write barrier elision for reference arrays
CN114265670B (zh) * 2022-03-02 2022-09-23 阿里云计算有限公司 一种内存块整理方法、介质及计算设备

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
US5915255A (en) 1997-04-23 1999-06-22 Sun Microsystems, Inc. Method and apparatus for referencing nodes using links
WO1999032978A1 (en) 1997-12-19 1999-07-01 Microsoft Corporation Incremental garbage collection
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
US5692193A (en) * 1994-03-31 1997-11-25 Nec Research Institute, Inc. Software architecture for control of highly parallel computer systems
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

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
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
WO1999032978A1 (en) 1997-12-19 1999-07-01 Microsoft Corporation Incremental garbage collection
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

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Amitabh Srivastava, Unreachable Procedures in Object-Oriented Programming, 1992, ACM, pp. 1-10. *
Pascal Fradet, Collecting More Garbage, 1994, ACM, pp. 1-10. *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040268323A1 (en) * 2003-06-26 2004-12-30 Matsushita Electric Industrial Co., Ltd Program converting method, program and storage medium
US7500229B2 (en) * 2003-06-26 2009-03-03 Panasonic Corporation Program converting method and storage medium
US20060026183A1 (en) * 2004-07-27 2006-02-02 Texas Instruments Incorporated Method and system provide concurrent access to a software object
US20180032347A1 (en) * 2016-07-31 2018-02-01 Oracle International Corporation Container-based language runtime using a variable-sized container for an isolated method

Also Published As

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

Similar Documents

Publication Publication Date Title
EP0881576B1 (en) Method and apparatus for generational garbage collection in a shared heap memory by means of multiple processor units
KR100541174B1 (ko) 로컬화된 메모리 재이용을 가진 데이터 처리기
US7650370B2 (en) System and method for regeneration of methods and garbage collection of unused methods
US6430580B1 (en) Method of replication-based garbage collection in a multiprocessor system
JP4079684B2 (ja) ヒープメモリ管理方法およびそれを用いた計算機システム
US7103723B2 (en) Priority-based code cache management
JP4064404B2 (ja) 適応型ガーベージコレクション方法及び前記方法を行う装置
US6185581B1 (en) Train-algorithm-based garbage collector employing fixed-size remembered sets
US7263700B1 (en) Serially, reusable virtual machine
US7979659B2 (en) Memory management method and computer using the method
US20050081190A1 (en) Autonomic memory leak detection and remediation
US6510440B1 (en) Method and apparatus for performing generational garbage collection using barrier bits
US20070073794A1 (en) Method for garbage collection of unused methods
US20010039609A1 (en) Data processor with localised memory reclamation
JPH10232785A (ja) 不連続な実行時スタックを動的にサイジングするための方法及び装置
JP2001034532A (ja) ガーベッジ収集中に空き領域を検出し合体させる方法およびシステム
US20040193828A1 (en) Memory recycling in computer systems
US7117318B1 (en) Memory management
Yang Java GC Tutorials-Herong's Tutorial Examples
US7146390B2 (en) Staging the processing of remembered-set entries as part of collection based on the train algorithm
CN116339965A (zh) 一种垃圾回收的方法和电子设备

Legal Events

Date Code Title Description
AS Assignment

Owner name: BEA SYSTEMS STOCKHOLM ENGINEERING AB, SWEDEN

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:DAHLSTEDT, JOAKIM;REEL/FRAME:013773/0604

Effective date: 20030627

Owner name: BEA SYSTEMS, INC., CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BEA SYSTEMS STOCKHOLM ENGINEERING AB;REEL/FRAME:013773/0641

Effective date: 20030627

STCF Information on status: patent grant

Free format text: PATENTED CASE

CC Certificate of correction
FPAY Fee payment

Year of fee payment: 4

AS Assignment

Owner name: ORACLE INTERNATIONAL CORPORATION, CALIFORNIA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:BEA SYSTEMS, INC.;REEL/FRAME:025084/0470

Effective date: 20100929

FPAY Fee payment

Year of fee payment: 8

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 12TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1553); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 12