Claims
- 1. A method for storing long-lived objects defined within an object-oriented programming system in a virtual machine for executing platform-independent code, wherein long-lived objects are created during initialization of the virtual machine, the method comprising;
allocating a storage area reserved for long-lived objects, wherein the storage area is not subject to garbage collection; receiving a request to create an object; determining if the object is identified in a table of long-lived objects; and if the object is identified as a long-lived object,
creating the long-lived object, and placing the long-lived object in the storage area.
- 2. The method of claim 1, wherein the storage area is an area of a heap used by the virtual machine.
- 3. The method of claim 2, wherein a remainder of the heap is subject to garbage collection.
- 4. The method of claim 1, wherein the long-lived object is a persistent string object.
- 5. The method of claim 4, wherein the persistent string object is a java.lang.String object.
- 6. The method of claim 1, further comprising closing the storage area to new objects when initialization of the virtual machine is complete.
- 7. The method of claim 6, further comprising allowing a garbage collector to reclaim unused storage in the storage area one time just prior to closing the storage area.
- 8. The method of claim 1, wherein the virtual machine is a JAVA VIRTUAL MACHINE.
- 9. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for storing long-lived objects defined within an object-oriented programming system in a virtual machine for executing platform-independent code, wherein long-lived objects are created during initialization of the virtual machine, the method comprising;
allocating a storage area reserved for long-lived objects, wherein the storage area is not subject to garbage collection; receiving a request to create an object; determining if the object is identified in a table of long-lived objects; and if the object is identified as a long-lived object,
creating the long-lived object, and placing the long-lived object in the storage area.
- 10. The computer-readable storage medium of claim 9, wherein the storage area is an area of a heap used by the virtual machine.
- 11. The computer-readable storage medium of claim 10, wherein a remainder of the heap is subject to garbage collection.
- 12. The computer-readable storage medium of claim 9, wherein the long-lived object is a persistent string object.
- 13. The computer-readable storage medium of claim 12, wherein the persistent string object is ajava.lang.String object.
- 14. The computer-readable storage medium of claim 9, wherein the method further comprises closing the storage area to new objects when initialization of the virtual machine is complete.
- 15. The computer-readable storage medium of claim 14, wherein the method further comprises allowing a garbage collector to reclaim unused storage in the storage area one time just prior to closing the storage area.
- 16. The computer-readable storage medium of claim 9, wherein the virtual machine is a JAVA VIRTUAL MACHINE.
- 17. An apparatus that facilitates storing long-lived objects defined within an object-oriented programming system in a virtual machine for executing platform-independent code, wherein long-lived objects are created during initialization of the virtual machine, the apparatus comprising;
an allocating mechanism that is configured to allocate a storage area reserved for long-lived objects, wherein the storage area is not subject to garbage collection; a receiving mechanism that is configured to receive a request to create an object; a determining mechanism that is configured to determine if the object is identified in a table of long-lived objects; a creating mechanism that is configured to create a long-lived object; and a placing mechanism that is configured to place the long-lived object in the storage area.
- 18. The apparatus of claim 17, wherein the storage area is an area of a heap used by the virtual machine.
- 19. The apparatus of claim 18, wherein a remainder of the heap is subject to garbage collection.
- 20. The apparatus of claim 17, wherein the long-lived object is a persistent string object.
- 21. The apparatus of claim 20, wherein the persistent string object is a java.lang.String object.
- 22. The apparatus of claim 17, further comprising a closing mechanism that is configured to close the storage area to new objects when initialization of the virtual machine is complete.
- 23. The apparatus of claim 22, further comprising a garbage collection triggering mechanism that is configured to trigger a garbage collector to reclaim unused storage in the storage area one time just prior to closing the storage area.
- 24. The apparatus of claim 17, wherein the virtual machine is a JAVA VIRTUAL MACHINE.
RELATED APPLICATION
[0001] The subject matter of this application is related to the subject matter in a co-pending non-provisional application by the same inventors as the instant application and filed on the same day as the instant application entitled, “METHOD AND APPARATUS FOR STORING SHORT-LIVED OBJECTS IN A VIRTUAL MACHINE,” having serial number TO BE ASSIGNED, and filing date TO BE ASSIGNED (Attorney Docket No. SUN-P5544-AES).