Hardware-Protected Reference Counting for Memory Cycle Reclamation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current memory reclamation techniques face challenges in efficiently managing large amounts of memory in modern computer systems, particularly due to the complexity of manual reclamation, inefficiencies in automatic methods like mark and sweep, and the inability to reclaim memory in cases of reference cycles.

Innovation Solution

The implementation of hardware-protected references, which use strong and weak reference counts to prevent cycles and facilitate automatic memory reclamation by ensuring that references between objects are either strong-weak or weak-weak pairs, allowing for efficient deallocation of objects that are no longer reachable.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If mark and sweep approach is used for automatic memory reclamation, then memory reclamation is automated, but the running time increases significantly as main memory size grows, creating more interference with application progress

Engineering Contradiction:
Improvememory reclamation automationVSAvoidrunning time for mark and sweep action
Core Design Contradiction:
Extent of automationVSLoss of time

Solution Approach 1:

The patent replaces the mechanical scanning process (mark and sweep) with a hardware-based reference counting mechanism. Each object maintains a reference count register that is automatically updated by hardware logic when objects are created or destroyed, eliminating the need for software-based scanning and significantly reducing memory reclamation time.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The memory management system performs self-service through automatic reference counting. The hardware automatically tracks object references and triggers deallocation when reference count reaches zero, eliminating the need for manual intervention or complex scanning algorithms while maintaining efficient memory reclamation.

Inventive Principle:
Principle #25Self-service

2Device complexity

If reference counting approach is used, then memory reclamation is simplified, but it cannot reclaim memory when there is a cycle in the references

Engineering Contradiction:
Improvememory management complexityVSAvoidmemory reclamation accuracy
Core Design Contradiction:
Device complexityVSReliability

Solution Approach 1:

The patent introduces asymmetric reference types (strong and weak references) to break symmetry in reference cycles. When an object has both strong and weak references, the weak references do not contribute to the reference count, allowing the system to detect and reclaim cyclic structures while maintaining simple reference counting logic.

Inventive Principle:
Principle #4Asymmetry

Solution Approach 2:

The patent applies different qualities to different types of references within the same system. Strong references increment the reference count and prevent deallocation, while weak references do not increment the count and allow deallocation even in cyclic structures. This local differentiation enables accurate memory reclamation without increasing overall system complexity.

Inventive Principle:
Principle #3Local quality

3Manufacturing precision

If manual memory reclamation is performed by the programmer, then memory management is precise, but development cost increases and errors become complex and difficult-to-diagnose

Engineering Contradiction:
Improvememory reclamation precisionVSAvoiddevelopment cost and error diagnosis
Core Design Contradiction:
Manufacturing precisionVSEase of manufacture

Solution Approach 1:

The hardware-based reference counting system performs memory reclamation automatically without requiring programmer intervention. The system self-manages object lifecycle through hardware logic that automatically increments and decrements reference counts, eliminating manual memory management tasks and associated errors while maintaining precise control over memory allocation and deallocation.

Inventive Principle:
Principle #25Self-service

4Reliability

If strong references are used to track object references, then object retention is ensured, but reference cycles prevent reclamation of unreachable objects

Engineering Contradiction:
Improveobject retention accuracyVSAvoidmemory reclamation efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent creates asymmetric reference types where strong references ensure object retention by incrementing reference count, while weak references provide cyclic structure detection without affecting reference count. This asymmetry allows the system to maintain reliable object retention for truly reachable objects while efficiently reclaiming memory from cyclic structures that should be unreachable.

Inventive Principle:
Principle #4Asymmetry

Data Source

PatentUS9274948B1Hardware-protected reference count-based memory management using weak references
Publication Date: 2016.03.01 INTEL CORP
  • US9274948B1 patent drawing
  • US9274948B1 patent drawing
  • US9274948B1 patent drawing

AI summary

A method for managing memory, comprising: maintaining a strong reference count for a first object; establishing a first reference from the first object to a second object; establishing a second reference from the second object to the first object, wherein the second reference is a weak reference that does not increase the strong reference count of the first object; detecting that the strong reference count of the first object has reached zero; in response to detecting that the strong reference count has reached zero, invoking a corresponding action.