Dynamic Memory Reclamation via Finalizer-Free Class Extension Detection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing programming environments retain memory and resources that are not used by the finalize method of a superclass, leading to reduced dynamic memory availability and performance issues due to incorrect memory management.
Innovation Solution
An improved method that marks related memory for retention only if it is not a class-extension with a finalizer-free characteristic, allowing for quicker reclamation of memory referenced by finalizable-objects, and conditions the marking for retention on the determination of whether the class-extension has a finalizer-free characteristic.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all related memory reachable from a finalizable-object is marked for retention, then the finalize-method can access all related memory, but memory is retained even when not needed by the finalize-method
Solution Approach 1:
The patent segments the class hierarchy into portions that require finalization and portions that do not. It identifies the specific class-extension that defines the non-trivial finalize-method and marks for retention only the memory related to that specific class-extension, rather than all memory reachable from the finalizable-object. This segmentation allows the finalize-method to access the memory it needs while enabling reclamation of memory not needed by finalization.
2Reliability
If memory is retained for potential finalization access, then the finalize-method can perform clean-up operations, but program performance degrades due to reduced available memory
Solution Approach 1:
The patent segments the memory retention scope to only include memory related to the class-extension that defines the non-trivial finalize-method. This reduces the amount of memory retained while still ensuring that the finalize-method can access the memory it needs for clean-up operations, thereby improving program performance without sacrificing resource clean-up capability.
Solution Approach 2:
The patent applies local quality by making the retention marking specific to certain portions of memory (those related to the class-extension with the finalize-method) rather than applying it globally to all reachable memory. This localized approach ensures that only the necessary memory is retained, improving overall program performance while maintaining the required clean-up functionality.
3Reliability
If all reachable memory is retained during finalization, then no memory is lost, but developers cannot freely subclass third-party classes due to stealth memory retention
Solution Approach 1:
The patent segments the memory retention behavior based on the class hierarchy structure. It identifies which class-extensions define finalize-methods and marks for retention only the memory related to those specific class-extensions. This allows developers to freely subclass third-party classes because the retention behavior is now predictable and localized to specific portions of the class hierarchy, eliminating stealth memory retention while preserving necessary memory.
Data Source
AI summary
Apparatus, methods, and computer program products are disclosed that improve management of a dynamic memory area. One aspect is a method that reclaims memory referenced by a finalizable-object that has been instantiated from a class definition that incorporates at least one parent class and one or more class-extensions into a class hierarchy. The method includes marking for retention a related memory reachable from a reference field of the finalizable-object, and adding the finalizable-object to a finalization set for subsequent invocation of a non-trivial finalize-method. The method also determines whether the portion of the finalizable-object that includes the reference field to the related memory is a class-extension that has a finalizer-free characteristic and conditions the marking for retention on that determination. Thus, a portion the finalizable-object's related memory can be more quickly reclaimed from a dynamic memory area.


