Heap Memory Measurement via Strongly-Connected Components
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current methods for measuring resource usage among multiple applications running under a single virtual machine face challenges such as insufficient resource isolation, inaccurate measurements due to object sharing, and high processing time, especially when applications share objects.
Innovation Solution
A method that identifies strongly-connected components in the heap and assigns memory responsibility to applications through a two-step process, adjusting for object sharing, which requires only two passes across application objects and can be merged with the garbage collector's pass for efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If a garbage-collection style traversal is performed from the root set of each application to determine resource usage, then resource usage can be measured, but processing time becomes proportional to the number of applications traversed
Solution Approach 1:
The patent segments the heap into strongly-connected components (SCCs), where each SCC is a maximal set of objects that can reach each other through reference cycles. By processing objects in SCCs rather than traversing from roots, the system divides the measurement task into independent, manageable units that can be processed in parallel and reduce overall processing time.
Solution Approach 2:
The patent performs preliminary actions by first identifying all SCCs in the heap before assigning resource usage. This preliminary classification of objects into SCCs with root applications allows subsequent resource assignment to be performed more efficiently without requiring full traversals, thus reducing processing time while maintaining measurement accuracy.
2Measurement precision
If objects allocated by one application are kept alive by another application are tracked, then resource usage can be measured, but measurement accuracy decreases due to object sharing
Solution Approach 1:
The patent segments the object graph into strongly-connected components, where each SCC is assigned to a root application. This segmentation allows the system to track which applications are responsible for which objects even when objects are shared across multiple applications, as each SCC can be uniquely identified and assigned based on its root application.
Solution Approach 2:
The patent introduces strongly-connected components as an intermediary structure between applications and objects. SCCs serve as mediators that capture the sharing relationships between applications and objects, allowing the system to accurately attribute resource usage while accounting for object sharing without requiring direct tracking of inter-application object references.
3Measurement precision
If explicit tracking of allocated and deallocated resources is performed, then resource usage can be measured, but memory overhead increases to track resources
Solution Approach 1:
The patent employs the garbage collector's existing traversal mechanisms to identify SCCs and assign resource usage. Instead of requiring separate explicit tracking infrastructure, the system leverages the GC's own processes (memory management, object traversal) to perform resource measurement, thereby avoiding additional memory overhead while maintaining measurement capability.
Solution Approach 2:
The patent makes the garbage collection process multi-functional by having it simultaneously perform both memory management (garbage collection) and resource usage measurement through SCC identification. This universal approach allows a single process to serve dual purposes, eliminating the need for separate tracking mechanisms and reducing overall memory overhead.
Data Source
AI summary
The present invention relates generally to a system and method for measuring application memory use, and more particularly to measuring heap usage of each of a plurality of applications running inside a single heap. Preferred embodiments of the present invention work by traversing a set of objects in a heap. During this traversal, sets of strongly connected components are identified. Additionally, representative objects of the sets of strongly connected components are identified and a topological sort order of the objects is established. Further, during a second traversal of the objects, the topological sort order is used to identify one or more applications responsible for each of the strongly connected component sets. And, in the process, the resource usage of each application is computed.


