Claims
- 1. A method of managing a generational memory, the method comprising:
sampling, at run-time of an execution sequence, lifetimes of a representative subset of memory objects in the generational memory; and pretenuring, based on the sampled lifetimes, at least some of the memory objects allocated from the generational memory during the execution sequence.
- 2. The method of claim 1,
wherein the pretenuring is performed for those of the memory objects for which corresponding sampled lifetimes exceed a first metric.
- 3. The method of claim 2,
wherein the pretenuring is reversed, if corresponding sampled lifetimes fall below a second metric.
- 4. The method of claim 1,
wherein the pretenuring is performed while corresponding sampled lifetimes exceed a metric.
- 5. The method of claim 1,
wherein the sampling includes sampling of representative subsets for plural categories of the memory objects; and further comprising:
allocating the memory objects using category-specific allocation functionality; and selectively modifying the category-specific allocation functionality to pretenure, on subsequent allocations, memory objects corresponding to those of the categories for which the sampled lifetimes exceed a metric.
- 6. The method of claim 5,
wherein the selective modification of the category-specific allocation functionality includes instantiating category-specific allocation methods that allocate new objects of a corresponding category directly into a tenured generation of the generational memory.
- 7. The method of claim 1,
wherein the sampled lifetimes are characterized as per-category, mean lifetimes.
- 8. The method of claim 1,
wherein the sampled lifetimes are characterized as per-category, distributions of lifetimes.
- 9. The method of claim 5,
wherein the categories are object class-specific.
- 10. The method of claim 5,
wherein the categories are call-site specific.
- 11. The method of claim 5,
wherein the categories correspond to activation record stack profiles.
- 12. The method of claim 5,
wherein the categories correspond to both type of memory object and call-site for allocation thereof; and wherein the selective modification of the category-specific allocation functionality includes in-lining instructions at the corresponding call-site, the in-lined instructions allocating new memory objects of the corresponding type directly into a tenured generation of the generational memory.
- 13. The method of claim 1,
wherein the sampling includes sampling of representative subsets of the memory objects for plural categories thereof; and wherein the pretenuring is performed on a category-specific basis.
- 14. The method of claim 1, further comprising:
establishing weak references to respective of the sampled memory objects and associating allocation-time information therewith; and identifying those of the sampled memory objects that become unreachable using the weak references.
- 15. The method of claim 14, wherein the weak references include one of:
phantom references; references of strength less than any other reference by which an unreachable one of the sampled objects may become reachable; and references of strength less than any other reference employed in the computational system.
- 16. The method of claim 1, further comprising:
selecting the representative subset based on allocation buffer overflow.
- 17. The method of claim 1, further comprising:
selecting the representative subset using per class allocator functionality.
- 18. The method of claim 1, further comprising:
selecting the representative subset based on identity of an allocating thread.
- 19. The method of claim 1, further comprising:
coincident with allocation of memory objects of the representative subset, establishing weak references thereto and associating therewith information indicative of at least allocation time and call site.
- 20. A method of operating an automatically reclaimed storage environment in accordance with object lifetime statistics, the method comprising:
selecting representative subsets of memory objects for each of plural categories thereof; sampling, during a program execution, lifetimes of memory objects from the representative subsets; and tailoring, during the program execution, a storage management action based on the sampled lifetimes for a corresponding one of the categories.
- 21. The method of claim 20,
wherein the storage management action includes pretenuring subsequently allocated memory objects of the corresponding category.
- 22. The method of claim 20,
wherein the storage management action includes promoting memory objects of the corresponding category to a particular generation.
- 23. The method of claim 20,
wherein the storage management action includes steering, on promotion, memory objects of the corresponding category to a particular store.
- 24. The method of claim 20,
wherein the storage management action includes allocating subsequently allocated memory objects of the corresponding category from a particular store.
- 25. The method of claim 24,
wherein the particular store is selected from the set of thread-local storage and global storage, based on the sampled lifetimes.
- 26. The method of claim 20,
wherein the storage management action includes modifying a category-specific allocator in accordance with a storage management policy adapted to the sampled lifetimes; and instantiating the modified, category-specific allocator.
- 27. The method of claim 20,
wherein the automatically reclaimed storage environment includes a generational garbage collector; and wherein the storage management action includes generation selection for unsampled instances of the memory objects.
- 28. A storage management facility for a computational system, the storage management facility comprising:
an object sampler operable to sample lifetimes of at least a subset of objects instantiated in the computational system during execution of a program; and a storage allocation facility operable during the execution of the program to allocate new objects corresponding to respective of the sampled objects based at least in part on the sampled object lifetimes.
- 29. The storage management facility of claim 28,
wherein the object sampler samples lifetimes on a per object category basis; and wherein operation of the storage allocation facility is particular to each object category and based at least in part on the lifetimes of the sampled objects corresponding thereto.
- 30. The storage management facility of claim 28,
wherein the storage allocation facility includes category-specific allocators; and wherein, in response to respective of the sampled object lifetimes exceeding a metric, the category-specific allocators are modified at run-time to pretenure objects allocated thereby.
- 31. The storage management facility of claim 28, wherein the categories correspond to one or more of:
object type; allocation call site; activation record stack state; thread id; and receiver object.
- 32. The storage management facility of claim 28,
wherein the object sampler is responsive to transition of at least one of the sampled objects from a reachable state to an unreachable state.
- 33. The storage management facility of claim 28,
wherein the object sampler employs a weak reference construct of the computational system to identify those of the sampled objects that have become unreachable.
- 34. The storage management facility of claim 33,
wherein the weak reference construct includes a phantom reference.
- 35. The storage management facility of claim 33,
wherein the weak reference construct includes a virtual-machine-level weak reference of strength less than any other weak reference by which an unreachable instance of the sampled objects may become reachable.
- 36. The storage management facility of claim 33,
wherein the weak reference construct includes a virtual-machine-level weak reference of strength less than any other weak reference employed in the computational system.
- 37. The storage management facility of claim 28, further comprising:
a garbage collector, wherein the object sampler is responsive to a storage management event of the garbage collector affecting one or more of the sampled objects.
- 38. The storage management facility of claim 37,
wherein the storage management event includes collection of one or more of the sampled objects.
- 39. The storage management facility of claim 37,
wherein the storage management event includes promotion of one or more of the sampled objects from a younger generation to an older generation.
- 40. The storage management facility of claim 37, embodied as a computer program product.
- 41. A computer program product encoded in at least one computer readable medium, the computer program product comprising:
at least one functional sequence for maintaining per-category object lifetime statistics based on a sampled subset of objects using weak references and associated allocation time information; and at least one functional sequence for tenuring objects in accordance with those of the object lifetime statistics corresponding thereto.
- 42. A computer program product as recited in 41,
wherein the tenuring sequence is instantiated for a particular category when corresponding object lifetime statistics exceed a metric.
- 43. A computer program product as recited in 42,
wherein the tenuring sequence replaces a category-specific allocator.
- 44. A computer program product as recited in 42,
wherein the tenuring sequence is replaced by a non-tenuring, category-specific allocator when corresponding object lifetime statistics fall below a second metric.
- 45. A computer program product as recited in 41,
wherein the at least one computer readable medium is selected from the set of a disk, tape or other magnetic, optical, or electronic storage medium and a network, wireline, wireless or other communications medium.
- 46. An apparatus comprising:
means for sampling instances of software objects to maintain lifetime predictions for categories thereof; and means for altering object category-specific storage management policies at run-time in response to the lifetime predictions.
- 47. The apparatus of claim 46, further comprising:
means for reversing the object category-specific storage management policies at run-time in response to the lifetime predictions.
CROSS-REFERENCE TO RELATED APPLICATION(S)
[0001] This application claims benefit of U.S. Provisional Application No. 60/204,454, filed May 16, 2000.
[0002] In addition, this application is related to U.S. patent application No. <not yet assigned, atty. docket no.: 004-4523>, entitled “OBJECT SAMPLING TECHNIQUE FOR RUNTIME OBSERVATIONS OF REPRESENTATIVE INSTANCES THEREOF,” naming Agesen, Garthwaite and Harris as inventors and filed on even date herewith, the entirety of which is hereby incorporated by reference.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60204454 |
May 2000 |
US |