Method and appartus for improved object allocation based on life-expectancy in a Garbage Collected run-time
Original Publication Date: 2009-May-13
Included in the Prior Art Database: 2009-May-13
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.
Method and appartus for improved object allocation based on life -expectancy in a Garbage Collected run-time
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
code during the development phase of the product
Ability to make the information on the life expectancy available to the run time (Garbage
Ability to be backward compatible. That is, the GC can honor or ignore the information
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
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).
Young objects (objects that the programmer does not expect to live longer).
Mature objects (objects that live substantially longer than others).
Permanent objects (objects that will be live for entire lifetime of the virtual machine).
Consider the source code snippet of a method implemented in Java™ in
1 . The code shows three objects being created and comments in the code indicate the life expectancy of each of them.
_ 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
provides a feature for programmers
We propose use of annotations to indicate to the runtime about the object's life-expectancy.
2 shows use of a custom annotation "ObjectAllocationPolicy".
3 shows the structure of the custom annotation.
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...