Shared Memory Partitioning for Parallel Web App Garbage Collection
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current deterministic parallel programming models for in-browser web applications face challenges in managing shared memory efficiently, leading to performance delays due to dynamic memory allocation and deallocation overhead, especially when dealing with large numbers of immutable objects, which limits the ability to leverage multi-core processors for parallel computing.
Innovation Solution
A system and method for automatic memory management that includes a memory management module monitoring thread execution and managing object life cycles within a shared memory space, partitioned into a nursery heap and mature heap with private nurseries, and a garbage collector module that performs safe-point-based garbage collection to optimize memory usage and reduce overhead.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If dynamic memory allocation and deallocation is performed for each thread in parallel processing, then memory flexibility is improved, but performance delays occur due to allocation overhead
Solution Approach 1:
The shared memory is segmented into multiple thread-local memory pools, with each pool dedicated to a specific thread. This segmentation allows each thread to allocate and deallocate memory independently within its own pool without affecting other threads, eliminating synchronization overhead and improving processing speed while maintaining memory flexibility.
Solution Approach 2:
Memory pools are pre-allocated and initialized before parallel thread execution begins. Each thread is assigned a dedicated memory pool in advance, so that during parallel execution, threads can immediately allocate memory from their pre-configured pools without dynamic allocation overhead, thus improving processing speed while preserving adaptability through controlled memory management.
2Quantity of substance
If shared memory is used for parallel threads, then memory utilization is improved, but synchronization overhead increases
Solution Approach 1:
The shared memory space is divided into separate thread-local pools, where each thread has its own dedicated memory region. This segmentation maintains high memory utilization by allowing efficient allocation within each pool while eliminating the need for complex synchronization mechanisms between threads, as each thread operates independently within its own memory segment.
3Reliability
If immutable objects are created in large numbers, then program correctness is improved, but memory overhead increases
Solution Approach 1:
The system automatically discards immutable objects that are no longer needed and recovers their memory space back to the thread-local memory pool. This allows the system to maintain program correctness by creating immutable objects when needed while minimizing memory overhead through automatic reclamation of unused objects, preventing memory leakage and optimizing memory utilization.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A system and method for automatic memory management of a shared memory during parallel processing of a web application. The system includes a computing system configured to allow parallel computing of a web application executed within a web browser. The computing system includes shared memory having a set of blocks distributed at least a first thread and at least one spawned thread of a processing function of the web application. The memory is partitioned into a nursery heap, a mature heap and a database having a plurality of private nurseries, wherein the first thread has access to the nursery heap and mature heap and the at least one spawned thread has access to an associated one of the plurality of private nurseries. During parallel computing of the web application, management of the shared memory includes garbage collection of at least each of the plurality of private nurseries.