Dynamic memory analyzer

From openharmonyinsight/openharmony-skills · View interactive version

Dynamic memory analyzer is an AI agent skill from the GitHub repository openharmonyinsight/openharmony-skills. Comprehensive dynamic memory management analysis for ace_engine codebase. Covers 17 critical scenarios: basic pairing, smart pointers (RefPtr/WeakPtr), exception safety, ownership transfer, container pointers, singletons, callbacks, multi-threading, cross-layer interaction, third-party libraries, sp

How to use this skill

Skill file

Dynamic Memory Analyzer

Comprehensive memory management analysis for ace_engine codebase covering 17 critical scenarios.

Quick Start

Use this skill to analyze memory management in ace_engine codebase:

  1. Statistical Analysis - Get overview metrics
  1. Pattern Detection - Identify specific issues
  1. Generate Report - Document findings

Core Scenarios

1. Basic Pairing

2. Smart Pointers

3. Exception Safety

4. Ownership Transfer

5. Container Pointers

6. Singletons

7. Callbacks

8. Multi-threading

9. Cross-layer

10. Third-party

11. Special Patterns

12. Common Leaks

13. nullptr Handling

14. Register/Unregister

15. Lifecycle Binding

16. Assignment Updates

17. Function Returns

Detailed Guidance

Statistical Analysis

See STATISTICS.md for comprehensive metrics and interpretation.

Pattern Detection

See PATTERNS.md for detection rules and examples.

Fix Recommendations

See FIXES.md for code examples and best practices.

Report Template

See REPORT_TEMPLATE.md for report structure.

Severity Levels

Tools

Static Analysis

# clang-tidy
clang-tidy --checks=-*,clang-analyzer-* frameworks/**/*.cpp

# cppcheck
cppcheck --enable=all frameworks/

# Custom scripts
bash scripts/stats.sh
bash scripts/detect_patterns.sh

Runtime Detection

# AddressSanitizer
ASAN_OPTIONS=detect_leaks=1 ./test_executable

# LeakSanitizer
LSAN_OPTIONS=suppressions=lsan.supp ./test_executable

# Valgrind
valgrind --leak-check=full ./test_executable

Best Practices

✅ Always Do

❌ Never Do

⚠️ Be Careful

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.