skills/ue-memory-leak-hunter/SKILL.md
Analyze UE5 memory reports to detect memory leaks, growth patterns, and optimization opportunities. Use when investigating memory issues, analyzing memreport output, tracking UObject growth, or debugging memory pressure on consoles. Triggers on "memory leak", "memreport", "memory growth", "OOM", "out of memory", "memory budget".
npx skillsauth add sipherxyz/universal-ue-skills ue-memory-leak-hunterInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze Unreal Engine memory reports to identify leaks, growth patterns, and optimization targets.
memreport -fullInstruct user to generate memreport:
# In UE console
memreport -full
# Or for specific categories
memreport -class
memreport -obj
Default output: {Project}/Saved/Profiling/MemReports/
Read the memreport file and extract:
Object Count Section:
Class Count NumBytes MaxBytes ResExcBytes ResExcBytesMax
----------------------------------------------------------------------------------------------
Texture2D 1523 892.45 MB ...
StaticMesh 3421 456.78 MB ...
SkeletalMesh 89 234.56 MB ...
Memory Pool Section:
FMalloc
Used: 2.34 GB
Peak: 2.89 GB
Waste: 156 MB
| Pattern | Severity | Indicator |
|---------|----------|-----------|
| Object count growing over time | Critical | Compare sequential memreports |
| Orphan UObjects without outer | High | Objects with Outer=None |
| Pending kill objects not collected | High | Large PendingKill count |
| Texture/Mesh duplicates | Medium | Same asset loaded multiple times |
| Delegate binding growth | Medium | Multicast delegate arrays growing |
| Platform | Memory Budget | Alert Threshold | |----------|---------------|-----------------| | PS5 | 12 GB usable | >10 GB | | Xbox Series X | 13.5 GB usable | >11 GB | | PC (min spec) | 8 GB | >6 GB |
Output format:
## Memory Analysis Report
### Executive Summary
- **Total Used**: {size}
- **Peak**: {peak}
- **Status**: {OK/WARNING/CRITICAL}
### Top Memory Consumers
| Rank | Class | Count | Size | % of Total |
|------|-------|-------|------|------------|
| 1 | {class} | {count} | {size} | {pct} |
### Leak Suspects
1. **{ClassName}** - {count} objects, {size}
- Growth rate: +{n} per minute
- Likely cause: {analysis}
- Fix: {recommendation}
### Recommendations
1. {Priority 1 fix}
2. {Priority 2 fix}
// WRONG - Never unbound
BeginPlay() { SomeDelegate.AddDynamic(this, &MyClass::Handler); }
// CORRECT - Unbound in EndPlay
EndPlay() { SomeDelegate.RemoveDynamic(this, &MyClass::Handler); }
// WRONG - Timer keeps reference
GetWorld()->GetTimerManager().SetTimer(Handle, this, &MyClass::Tick, 1.0f, true);
// CORRECT - Clear in EndPlay
EndPlay() { GetWorld()->GetTimerManager().ClearTimer(Handle); }
// WRONG - Handle not stored
StreamableManager.RequestAsyncLoad(Path, Callback);
// CORRECT - Store and cancel
TSharedPtr<FStreamableHandle> Handle = StreamableManager.RequestAsyncLoad(Path, Callback);
// Cancel in destructor if still loading
// WRONG - Widget created but never removed
UUserWidget* W = CreateWidget<UUserWidget>(this, WidgetClass);
W->AddToViewport();
// CORRECT - Track and remove
if (ActiveWidget) { ActiveWidget->RemoveFromParent(); }
ActiveWidget = CreateWidget<UUserWidget>(this, WidgetClass);
| Command | Purpose |
|---------|---------|
| memreport -full | Complete memory dump |
| obj list class=Texture2D | List specific class |
| obj gc | Force garbage collection |
| gc.CollectGarbageEveryFrame 1 | Debug GC |
| obj refs class=MyClass | Show references |
For Huli/S2 project, check these common sources:
USipherGameplayAbility instances not ending properlyASipherAICharacter pooling issuesSipherComboGraph state accumulationUSipherHitReaction delegate leaksdevelopment
This skill should be used when implementing features in isolation using git worktrees. Triggers on "create worktree", "isolated workspace", "parallel development", or when starting implementation that should not affect main workspace.
testing
Manage VFX team issues on GitHub Projects - timeline scheduling, status updates, member commit checks, bulk assign. Use when managing VFX team project board, adding issues to timeline, checking member progress, or bulk-updating issue fields.
tools
Generate C++ validation rules from JSON definitions. Use when team updates ValidationRules.json or asks to add/modify validation rules.
development
Check codebase for Microsoft Xbox XR (Xbox Requirements) compliance issues. Scans for account picker, cloud saves, achievements, Quick Resume, and Xbox certification requirements. Use before console submission or when preparing for Microsoft certification. Triggers on "XR", "Xbox certification", "Microsoft compliance", "Xbox cert", "Xbox requirements", "GDK compliance".