Mutable Type Builder Over-Allocation Strategy

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing implementations of mutable types, such as arrays and strings, require post-operation memory allocation and copying of elements, leading to inefficiencies and additional garbage collection, especially when the number of data elements is not known in advance.

Innovation Solution

A method is introduced to build mutable types by over-allocating an internal buffer, allowing elements to be added or removed without resizing, and then garbage collecting the unused portion, eliminating the need for post-operation memory allocation and copying.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional memory allocation methods are used for mutable types, then memory management is straightforward, but post-operation memory allocation and copying of elements is required, leading to inefficiency and additional garbage collection

Engineering Contradiction:
Improveefficiency of mutable type creationVSAvoidtime for post-operation memory allocation and copying
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by over-allocating memory buffer space during the initial creation of mutable types (arrays and strings). Instead of allocating memory based on exact element count, the system pre-allocates a larger buffer that can accommodate future element additions without requiring reallocation. This preliminary over-allocation eliminates the need for post-operation memory allocation and copying, directly resolving the technical contradiction by improving productivity while reducing time loss.

Inventive Principle:
Principle #10Preliminary action

2Quantity of substance

If exact memory allocation is used based on known element count, then memory usage is optimized, but additional memory allocation and copying is needed when element count is not known in advance

Engineering Contradiction:
Improvememory usage efficiencyVSAvoidcomplexity of memory management operations
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent applies partial or excessive action by intentionally over-allocating memory buffer space beyond the immediate needs of the mutable type. Rather than allocating exactly the required amount of memory, the system allocates a larger buffer that exceeds current element requirements. This excessive allocation simplifies memory management by eliminating the need for complex reallocation and copying operations when elements are added, trading some initial memory overhead for reduced operational complexity.

Inventive Principle:
Principle #16Partial or excessive action

3Adaptability or versatility

If mutable types are implemented with dynamic resizing, then flexibility is improved, but unnecessary memory reallocations and garbage collection occur

Engineering Contradiction:
Improveflexibility of mutable type manipulationVSAvoidenergy for memory reallocation and garbage collection
Core Design Contradiction:
Adaptability or versatilityVSLoss of energy

Solution Approach 1:

The patent applies preliminary action by pre-allocating sufficient memory buffer space during the creation of mutable types to accommodate expected element additions. This preliminary over-allocation provides the flexibility needed for dynamic manipulation of arrays and strings without triggering memory reallocation operations. By having sufficient buffer space available from the start, the system maintains adaptability while avoiding the energy-consuming garbage collection cycles that would otherwise be required to manage reallocated memory.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentEP3539001B1Mutable type builder
Publication Date: 2024.10.16 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP3539001B1 patent drawingFigure 1
  • EP3539001B1 patent drawingFigure 2~3
  • EP3539001B1 patent drawingFigure 4~5

AI summary

A computing device implemented method for building a mutable type is disclosed. A data structure is generated in a contiguous section of memory. The data structure includes an element portion and an over-allocation portion. The element portion stores elements accessible with an index. A gap object is inserted into the over-allocation portion. The gap object is garbage collected.