Offline Execution Trace Replay for Memory Leak Diagnosis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Diagnosing memory leaks and poor memory utilization in software services is challenging, especially in production environments where services cannot be halted for debugging, leading to indirect workarounds like server reboots.

Innovation Solution

A method and system for determining performance measurements through offline replay of a program's execution trace, capturing and replaying the trace with additional memory monitoring, and running heuristic checks to identify memory leaks and poor memory use, providing insights without impacting production users.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Difficulty of detecting and measuring

If the service is halted to attach a debugger for diagnosing memory leaks, then diagnostic capability is improved, but service availability and user impact deteriorate

Engineering Contradiction:
Improvediagnostic capabilityVSAvoidservice availability
Core Design Contradiction:
Difficulty of detecting and measuringVSReliability

Solution Approach 1:

The system performs preliminary actions by capturing execution traces, memory snapshots, and allocation information during normal production operation before any diagnostic intervention is needed. This preliminary data collection enables subsequent offline analysis without requiring service interruption, thus maintaining service availability while improving diagnostic capability.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system creates a copy of the execution trace and memory state data, allowing diagnostic analysis to be performed on this copy rather than on the live production system. This copying approach enables comprehensive debugging without impacting the original service operation, resolving the contradiction between diagnostic capability and service availability.

Inventive Principle:
Principle #26Copying

2Loss of information

If memory monitoring is performed during production operation, then diagnostic information is captured, but system overhead and performance impact increase

Engineering Contradiction:
Improvediagnostic informationVSAvoidsystem overhead
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

Solution Approach 1:

The system instruments the JVM to capture execution traces and memory allocation information into a separate data structure (execution trace with snapshots) rather than continuously analyzing live memory. This copying approach minimizes overhead during production operation while preserving complete diagnostic information for later offline analysis.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system performs preliminary data collection by capturing execution traces and memory snapshots at predetermined intervals during normal operation. This preliminary action stores diagnostic information efficiently without continuous heavy processing, reducing real-time system overhead while ensuring diagnostic data is available when needed.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If the service is rebooted to work around memory leaks, then service stability is restored, but diagnostic information is lost and the root cause remains unidentified

Engineering Contradiction:
Improveservice stabilityVSAvoiddiagnostic information
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The system performs preliminary action by capturing and storing execution traces, memory snapshots, and allocation site information before memory leaks cause service instability. This preserved diagnostic information enables root cause analysis and permanent fixes rather than temporary reboot workarounds, maintaining both service stability and diagnostic information.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system provides feedback by analyzing captured execution traces and memory data to identify the root causes of memory leaks, such as specific allocation sites and call stacks. This feedback loop replaces blind reboot workarounds with informed diagnostic insights, enabling permanent resolutions that maintain service stability without losing diagnostic information.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS10331543B2Performance diagnostics via offline replay
Publication Date: 2019.06.25 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10331543B2 patent drawing
  • US10331543B2 patent drawing
  • US10331543B2 patent drawing

AI summary

Methods and systems for performance measurements of a program are provided. An execution trace of the program may be captured and stored. The stored execution trace may be replayed in an offline mode. Performance measurements for the program may be determined based on the replaying of the execution trace in the offline mode.