Memory Deduplication via Copy-on-Write Mapping Simulator

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing memory management systems, such as those in the Windows operating system, face inefficiencies due to duplicate physical pages containing the same content, leading to memory waste. Currently, the KSM technology from the Linux operating system cannot be directly applied to Windows to address this issue.

Innovation Solution

A method and apparatus for setting memory are introduced, which utilize a simulator running in the user space of a terminal device with a first operating system. This setup allows for the application of a copy-on-write instruction to map a first virtual memory space to a second virtual memory space, optimizing memory usage by reducing physical memory occupation and simulating the KSM technology without requiring a full Linux system emulation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If KSM technology is directly applied to Windows system to merge same page content, then memory occupation is reduced, but the system complexity increases due to need to simulate Linux operating system completely

Engineering Contradiction:
Improvememory occupationVSAvoidsystem complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent extracts the essential function of KSM (merging same page content) from the Linux kernel and implements it independently in the Windows user space through a simulator. This separates the memory deduplication function from the complete Linux system simulation, reducing the complexity burden while maintaining the memory saving benefit.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces a simulator as an intermediary layer between the Windows system and the memory management function. This simulator runs in user space and provides the KSM functionality without requiring full Linux kernel simulation, acting as a mediator that bridges the functional need with the platform constraints.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Quantity of substance

If complete Linux operating system simulation is used to implement KSM technology, then memory deduplication function is achieved, but application compatibility is reduced

Engineering Contradiction:
Improvememory deduplicationVSAvoidapplication compatibility
Core Design Contradiction:
Quantity of substanceVSAdaptability or versatility

Solution Approach 1:

The patent extracts only the necessary memory management function (page content merging) from the Linux operating system and implements it in a lightweight simulator. This selective extraction maintains application compatibility by avoiding the need to simulate the entire Linux environment, while still achieving the desired memory deduplication effect.

Inventive Principle:
Principle #2Taking out (Extraction)

3Speed

If multiple physical pages with same content are maintained, then memory access speed is improved, but memory waste increases

Engineering Contradiction:
Improvememory access speedVSAvoidmemory waste
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The patent merges physical pages that contain the same content into a single shared physical page. By combining redundant pages, it eliminates memory waste while maintaining fast access speeds through the mapping mechanism that allows multiple virtual addresses to reference the same physical content efficiently.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent uses copy-on-write mapping to create virtual copies of page content without immediately creating physical copies. This allows multiple processes to share the same physical page content, reducing memory waste, while maintaining the illusion of separate pages for access purposes. Physical copying only occurs when modifications are needed.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS12332808B2Method and apparatus for setting memory, and electronic device and storage medium
Publication Date: 2025.06.17 NETEASE (HANGZHOU) NETWORK CO LTD
  • US12332808B2 patent drawing
  • US12332808B2 patent drawing
  • US12332808B2 patent drawing

AI summary

A method and apparatus for setting memory, and an electronic device and a storage medium. The method comprises: obtaining a memory application instruction generated by a process corresponding to a simulator; determining target number of times of mappings for a first virtual memory space according to the memory application instruction; determining remaining number of times of mappings of the first virtual memory space; determining whether the remaining number of times of mappings is zero; if not, mapping the first virtual memory space to a second virtual memory space by using a copy-on-write instruction, updating the remaining number of times of mappings, and returning to the step of determining whether the remaining number of times of mappings is zero; and if yes, stopping mapping the first virtual memory space to the second virtual memory space by using the copy-on-write instruction.