Browse Prior Art Database

Method and appartus for improved object allocation based on life-expectancy in a Garbage Collected run-time

IP.com Disclosure Number: IPCOM000183046D
Original Publication Date: 2009-May-13
Included in the Prior Art Database: 2009-May-13
Document File: 4 page(s) / 226K

Publishing Venue

IBM

Abstract

In a virtual machine environment like the Java Virtual Machine (JVM), garbage collector (GC) subsystem is responsible for object allocation and garbage collection. The state of the art GC algorithm used by most of the Java implementations is Generational GC.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 4

Method and appartus for improved object allocation based on life -expectancy in a Garbage Collected run-time

                     Authors
Ajith Ramanath, Shirish Kuncolienkar, Apurva Sinha1, Anandha S Srinivasan, Manish Gupta, Prashanth K Nageshappa

A method of passing information to the garbage collector via source code constructs is proposed. Proposed method will achieve the following:

Ability to add information on the life expectancy of components embedded in the source

a.

code during the development phase of the product


Ability to make the information on the life expectancy available to the run time (Garbage

b.

Collector)

Ability to be backward compatible. That is, the GC can honor or ignore the information

c.

passed on to it. This way, the proposed method is backward compatible which is very

important for any popular development platform like Java or C#.
For instance, it is possible to add new language constructs (say, new


a.

would help the developers looking at existing code at a later date

A language that requires a virtual run-time, like Java™,

using which they can associate meta-data with the source code for internal book-keeping. Comments and annotations are some such possible ways by which a developer can achieve the same.

In the current disclosure, we propose to extend the usability of annotations by which the virtual machine executing the binary application code can pick up specific metadata as hints during object allocations.

We propose to divide the objects into four broad categories:

Method local objects (objects that are local to a method and do not escape).

a.

Young objects (objects that the programmer does not expect to live longer).

b.

Mature objects (objects that live substantially longer than others).

c.

Permanent objects (objects that will be live for entire lifetime of the virtual machine).

d.

Consider the source code snippet of a method implemented in Java™ in

figure

                                             1 . The code shows three objects being created and comments in the code indicate the life expectancy of each of them.

1

foreve

r

Hashtable()

                                        _ will live as long as the application lives). But such solution will not be backward compatible.

Ability for IDE track the life-expectancy of Objects in source code (while displaying) that

type construct to Java - and that means, that

Hashtable

d.

provides a feature for programmers

Page 2 of 4

Figure

1

We propose use of annotations to indicate to the runtime about the object's life-expectancy.

Figure

2 shows use of a custom annotation "ObjectAllocationPolicy".

Figure

2

Figure

3 shows the structure of the custom annotation.

Figure

3

When the above source code is compiled, the associated annotation will be included into the generated byte codes.

We propose to have an additional step during class loading during which the class loader will interpret the annotation and create internal data structures that wi...