Method and apparatus for storing short-lived objects in a...

Data processing: database and file management or data structures – Database design – Data structure types

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S148000

Reexamination Certificate

active

06581077

ABSTRACT:

BACKGROUND
1. Field of the Invention
The present invention relates to objects defined within an object-oriented computer programming system. More specifically, the present invention relates to a method and apparatus for storing short-lived objects within an object-oriented computer programming system.
2. Related Art
The recent proliferation of ever smaller and more capable computing devices has lead to the use of platform-independent programming languages on these smaller devices. Platform-independent programming languages facilitate the creation of programs that can be compiled to a set of platform-independent codes, which can be executed on a variety of computing devices. Many of these computing devices have a virtual machine (VM) containing an interpreter or just-in-time compiler to execute these platform-independent codes. The JAVA™ programming language is an example of a platform-independent programming language and JAVA bytecodes are an example of platform-independent codes.
The terms JAVA, JVM and JAVA VIRTUAL MACHINE are registered trademarks of SUN Microsystems, Inc. of Palo Alto, Calif.
Many VMs use an area of memory called a heap to store various objects. When an object in the heap is no longer needed, all references pointing to the object will have been deleted. However, the object continues to occupy space in the heap. In some VMs, a computer program called a garbage collector scans the heap and deletes objects that are not being referenced in order to reclaim unused space in the heap.
There are many implementations of garbage collectors, however, they all share some traits. Garbage collectors require resources of the computing device in order to operate. This uses storage space in the computing device and slows execution times of running programs. There have been many attempts to reduce the impact of garbage collection on executing programs. For instance, a garbage collector can be run in a separate execution thread. If the computing device has more than one processor, the separate execution thread can run on another processor, thereby reducing the impact on the main execution thread.
Another attempt to reduce the impact of garbage collection involves the use of so called “generational garbage collectors.” These work by migrating long-lived objects to an area of the heap where garbage collection is performed less often and leaving short-lived objects in an area of the heap where garbage collection is performed more often and possibly performed using a different method.
Neither of these techniques, however, is well suited for small computing devices. Small computing devices have only one processor, therefore running a separate garbage collection thread causes the main program thread to be “swapped out” during garbage collection. Furthermore, generational garbage collectors require large amounts of storage space, which may not be available on a small computing device.
Moreover, many VMs generate a large number of objects that will remain active for only a very short period of time. For example, the JAVA runtime environment creates a large number of java.lang.StringBuffer objects, which remain available for only several instructions or, at most, during the lifetime of a single function of a program. These objects occupy a considerable portion of the normal heap and, as a result, cause the garbage collector to consume a considerable amount of processor time, even though these objects never remain in the heap for more than one cycle of the garbage collector.
As an example of how these short-lived objects are created, consider the following JAVA source code.
class StringBufferTst {
Object x;
public static void main(String[ ] args) {
String s
1
=“Hello “;
String s
2
=“StringBuffer”;
System.out.println(s
1
+s
2
);
}
}
When compiled by a JAVA compiler, the JAVA source code is translated into the following series of bytecodes.
Method void main(java.lang.String[ ])
0
ldc #
2
<String “Hello ”>
2
astore_
1
3
ldc #
3
<String “StringBuffer”>
5
astore_
2
6
getstatic #
4
<Field java.io.Printstream out>
9
new #
5
<Class java.lang.StringBuffer>
12
dup
13
invokespecial #
6
<Method java.lang.StringBuffer( )>
16
aload_
1
17
invokevirtual #
7
<Method java.lang.StringBuffer
append(java.lang.String)>
20
aload_
2
21
invokevirtual #
7
<Method java.lang.StringBuffer
append(java.lang.String)>
24
invokevirtual #
8
<Method java.lang.String toString( )>
27
invokevirtual #
9
<Method void
println(java.lang.String)>
30
return
Note that the object created by bytecode number
9
is short-lived. In fact, this object has no useful life after bytecode number
27
.
What is needed is a system that eliminates the waste of resources caused by the garbage collector operating on objects that are usually deleted shortly after being created.
SUMMARY
One embodiment of the present invention provides a system for storing short-lived objects defined within an object-oriented programming system. These short-lived objects are created in a virtual machine used for executing platform-independent code and are ordinarily created during normal operation of the virtual machine. The system works by allocating a storage area reserved for short-lived objects that uses a method of garbage collection optimized for short-lived objects. After the storage area is allocated, the system receives requests to create an object. The system then determines if the object is a short-lived object by referring to a table of short-lived objects. If the object is a short-lived object, it is created and placed in the reserved storage area.
In one embodiment of the present invention, the reserved storage area is an area of a heap used by the virtual machine.
In one embodiment of the present invention, the remainder of the heap is subject to garbage collection using a method that is optimized for objects of ordinary life span.
In one embodiment of the present invention, the short-lived object is a transient string buffer object.
In one embodiment of the present invention, the transient string buffer object is a java.lang.StringBuffer object.
In one embodiment of the present invention, the storage area is organized into an array of objects.
In one embodiment of the present invention, an element of the array is sized to accommodate a largest short-lived object within the virtual machine.
In one embodiment of the present invention, the virtual machine is a JAVA VIRTUAL MACHINE.


REFERENCES:
patent: 2655091 (1953-10-01), Geiger
patent: 3524398 (1970-08-01), Winfrey
patent: 3941034 (1976-03-01), Helwig et al.
patent: 4768423 (1988-09-01), Boeger
patent: 5136706 (1992-08-01), Courts
patent: 6068675 (2000-05-01), Tsuda et al.
patent: 6125434 (2000-09-01), Willard et al.
patent: 6136055 (2000-10-01), Stanek
patent: 6200465 (2001-03-01), Carawan et al.
patent: 6434575 (2002-08-01), Berry et al.
patent: 6446257 (2002-09-01), Pradhan et al.
patent: 6457111 (2002-09-01), Howard et al.
Yuping Ding; Xining Li Titled “Cache performance of chronological garbage collection” IEEE Canadian Conference on , vol.: 1 , May 24-28, 1998 pp.: 1-4 vol. 1.

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Method and apparatus for storing short-lived objects in a... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Method and apparatus for storing short-lived objects in a..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Method and apparatus for storing short-lived objects in a... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3120071

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.