Fork-aware Smart Pointers for Multiprocessing Memory Efficiency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In multiprocessing environments, smart pointers cause inefficient memory usage and potential memory leaks due to copy-on-write operations triggered by read-only memory accesses, as they increment reference counts even when memory is accessed for reading, leading to unnecessary copying of memory and increased memory usage.

Innovation Solution

A modified smart pointer that only increments the reference count for the process that originally allocated the memory, avoiding changes in other processes, thus preventing copy-on-write operations during read-only memory accesses and reducing memory usage, while maintaining counters only for the original allocating process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If smart pointers increment reference count for every memory access including read-only operations, then memory management is automated and leak prevention is improved, but copy-on-write operations are triggered unnecessarily causing increased memory usage

Engineering Contradiction:
Improvememory leak preventionVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent applies local quality by differentiating the behavior of smart pointers based on the process context. The reference count is incremented only in the original allocating process, while forked processes use a different reference counting mechanism. This localized differentiation allows read-only operations in forked processes to not trigger copy-on-write, reducing memory usage while maintaining leak prevention in the allocating process.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent segments the reference counting functionality into process-specific counters. Instead of a unified reference count shared across all processes, each process has its own reference count that is updated only when that process performs memory operations. This segmentation prevents unnecessary copy-on-write operations in forked processes while maintaining proper memory management.

Inventive Principle:
Principle #1Segmentation

2Ease of operation

If multiprocessing is used to avoid thread-safety requirements, then ease of operation for legacy software is improved, but memory efficiency is reduced due to private memory copies

Engineering Contradiction:
Improvethread-safety requirementVSAvoidmemory efficiency
Core Design Contradiction:
Ease of operationVSQuantity of substance

Solution Approach 1:

The patent uses selective copying through copy-on-write optimization. Instead of creating private memory copies for all multiprocessing scenarios, the system allows forked processes to share parent process memory through a refined reference counting mechanism. Memory is copied only when necessary (when the reference count indicates modification), not during read-only operations, thus improving memory efficiency while maintaining multiprocessing benefits.

Inventive Principle:
Principle #26Copying

3Quantity of substance

If copy-on-write is used to optimize memory usage in multiprocessing, then memory efficiency is improved, but smart pointer reference counting triggers unnecessary copies during read-only accesses

Engineering Contradiction:
Improvememory efficiencyVSAvoidread-only operation performance
Core Design Contradiction:
Quantity of substanceVSProductivity

Solution Approach 1:

The patent applies local quality by implementing process-specific reference counting behavior. In the original allocating process, reference counts are incremented for all operations to ensure proper memory management. In forked processes, reference counts are not incremented for read-only operations, allowing efficient memory sharing without triggering copy-on-write. This localized differentiation resolves the contradiction between memory efficiency and read-only operation performance.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10649809B2Fork-aware smart pointers
Publication Date: 2020.05.12 JPMORGAN CHASE BANK NA
  • US10649809B2 patent drawing
  • US10649809B2 patent drawing
  • US10649809B2 patent drawing

AI summary

A system for and method of allocating and deallocating memory in a multiprocessing computing environment that improves the management of memory by the various processes and sub-processes in the multiprocessing environment are disclosed. The system and method improve the allocation and deallocation of memory for sub-processes that are limited to performing memory read operations.