Summary: | 碩士 === 國立臺灣大學 === 資訊工程學研究所 === 92 === Java is a programming language with increasing popularity. Being object-oriented, objects are the basic elements that a programmer can manipulate. For the runtime system, objects can be allocated on demand by programmers, but there is no way that one can explicitly deallocate objects on the heap. In fact, Java depends on the runtime garbage collection to handle space reclamation.
To cope with the costly garbage collection problem, two essential techniques are discussed. One is the classification/separation of objects, i.e., objects are classified according to their lifetimes and are separated with different allocation/deallocation policies. The other is the cooperative approach for memory management, i.e., a compiler (either static-time or dynamic-time) analyzes program code and produces information about objects generated in the program, and then the runtime system can use the information to make better use of heap memory space.
This thesis exploits the previous two techniques and extends the escape analysis that has been studied before. All existing escape analyses try to separate method-local objects from method-nonlocal ones, and stack-allocate method-local objects since their lifetimes are bounded by their allocating methods. We further propose the extended version of escape analysis; it tries to determine the upper bound of lifetime for some method-nonlocal objects and still stack-allocates them. The key idea is that we find how far an object can escape and how long it can be reachable; these are done by a static-time compiler. For the runtime system, it allocates objects with pre-determined lifetime on stack rather than on heap, and this can lessen the burden of garbage collector since those objects can be allocated/deallocated in the stack manner (first-in-last-out) without the intervention of garbage collector.
|