Methods for managing memory in a run-time environment...

Electrical computers and digital processing systems: memory – Storage accessing and control – Memory configuring

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C707S793000, C717S118000

Reexamination Certificate

active

06711657

ABSTRACT:

FIELD OF THE INVENTION
The present invention relates to computer systems and more particularly to a method for managing memory in a run-time environment.
BACKGROUND OF THE INVENTION
A dynamic run-time environment for a programming language, such as JAVA™, is responsible for managing memory for objects that are created and destroyed during the execution of a program. An object is an entity that encapsulates data and, in some languages, operations associated with the object. Since the encapsulated data is stored in memory, objects are associated with particular regions of memory that are allocated and deallocated by the dynamic run-time environment.
The state of a program, or “program state,” is the set of the objects and the references between the objects that exist at a specific point in time during the execution of the program. A “reference” is used by a run-time environment to identify and ultimately access the region of memory for storing the data of the object. Typically, references between objects in a run-time environment are encoded using machine pointers. A machine pointer is an instance of a native type that contains the address of the object in the main memory, which can be a real memory address or, more commonly, a virtual address on a machine that implements a virtual memory system.
One popular run-time environment is a JAVA™ programming language virtual machine, which supports a platform-independent, object-oriented language developed by Sun Microsystems. In the JAVA™ programming language, the attributes and methods for a class of objects are typically defined in a source file, which is compiled into an architecture-neutral object file containing bytecodes that are interpreted in the virtual machine at the target platform. It is common for objects to reference other objects.
Lately, there has been much interest in using the JAVA™ programming language in a multi-user environment that allows multiple users to connect in separate, concurrent sessions to a server system, such as a relational database system. When designing a run-time environment for such a multi-user environment, scalability in terms of the number of simultaneous users who can establish separate sessions is very important. A significant constraint for user scalability is the size of the memory footprint that each session consumes. For example, a server system may have 100 megabytes (Mb) of memory for supporting all the user sessions. If the session memory footprint is 1 Mb, then only 100 users can be supported at one time. Therefore, it is desirable to reduce the session memory footprint to improve scalability.
One approach for reducing the session memory footprint is to provide a shorter duration memory named “call memory” that is active for the duration of a “call” but automatically deallocated when the call terminates A call is the period of time, when the user is actively using the server, such as during execution of a Structured Query Language (SQL) statement in a database server. Accordingly, those objects that do not need to live beyond the duration of the call are placed in the call memory rather than session memory. When the call is completed, objects in the call memory are deallocated and the call-duration memory is reclaimed for use. This approach has been implemented in Oracle Corporation's PL/SQL™ language, for instance, in which objects are explicitly declared as having the duration of a call or of a session. Memory management in such a language is straightforward because the objects are simply allocated in the memory that corresponds to their duration.
The JAVA™ programming language, however, defines the lifetime of many objects, especially system objects, to extend throughout the duration of a session and does not have the notion of a call or call duration in the programming model. Therefore, the run-time environment mush have a policy for using call memory. Accordingly, one approach is to simply ignore the provision of the call memory by the multi-user system and allocate every object in session memory, but this approach suffers from scalability because short-lived objects are unnecessarily allocated in session memory.
Another approach is to allocate objects first in the shorter-duration call memory, and then, at the time the call terminates, migrate the objects into the longer duration session memory. In this approach, session memory is consumed only if the object is still alive at the end of the call. The JAVA™ programming language, however, imposes restrictions on this approach by requiring several system classes to store large objects in static class variables. Use of static class variables is also common in user code. In many cases, the state of the these objects is no longer relevant after the call, but they are still considered alive at the end of the call. Therefore, the above-described migration policy causes these large objects to be migrated into session memory even though the state of the large object is no longer relevant, thereby increasing session memory requirements per session and reducing scalability.
For example, the standard input, output, and error streams maintain large input/output (I/O) buffers that merely reserve space for temporary use by the streams. Typically, when the call terminates the I/O buffers are flushed so that no meaningful information remains in the buffer. However, the I/O buffer itself is still a live object, being referenced by its stream class. Therefore, the migration process of copying a stream object at the end of the call to session memory forces the copying of a large, but essentially empty object into session space.
In this example, there is a problem if the user directly attempts to reduce the session memory consumed by these objects by unreferencing the I/O buffer before the end of the call. Unreferencing an object causes the garbage collector to deallocate the object at the end of the call. If the I/O buffer was unreferenced, the I/O buffer would not be available for use in the finalization of other garbage collected objects at the end of call. Some objects, for example, will print an error message using a stream in their finalization code, which is called when the objects are garbage collected. In this scenario, at worst, the null I/O buffer would cause a run-time error or exception, and, at best, the I/O buffer would be reallocated. In the latter case, the I/O buffer is still alive at the end of call and is therefore migrated to session memory, thereby defeating the purpose of the user's direct attempt to reduce the session memory usage.
The space used by such objects is substantial, on the order of 150 Kb for a JAVA™ programming language “Hello World” program, thereby seriously affecting the scalability of the system. Therefore, there is a need for improving the scalability of such run-time environments.
SUMMARY OF THE INVENTION
This and other needs are addressed by the present invention by providing a mechanism for registering a routine to deinitialize the large object in a class static variable at the end of call (e.g. by setting the class variable to null to unreference the large object), which prevents the large object from being migrated into session memory. This routine is called after the finalization of garbage collected objects that may use the large object. In a subsequent call, the large object is checked before use and re-initialized if the large object was still deallocated. In the stream example, after finalization of garbage collected objects, the I/O buffer is deinitialized, thereby preventing the I/O buffer from being copied into session memory. When the stream is later used in another call, the I/O buffer is checked and, if null, re-initialized.
Accordingly, one aspect of the invention relates to a method and software for managing memory in a run-time environment by registering a routine to deinitialize an object at an end of a call, and, at the end of the call, executing the routine to deinitialize the object. This method may be implemented in a context in which live objects are migrated from a shorte

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

Methods for managing memory in a run-time environment... does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Methods for managing memory in a run-time environment..., we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Methods for managing memory in a run-time environment... will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-3250326

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