coreclr-gc-watchdog

Audit Unity C# code for CoreCLR GC pressure and apply zero-alloc patterns.

71|11|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/nlelouche/Unity-SkillForge --skill coreclr-gc-watchdog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coreclr-gc-watchdog
Source: https://github.com/nlelouche/Unity-SkillForge/tree/main/.agent/skills/00-core-engineering/coreclr-gc-watchdog
Command: npx skills add https://github.com/nlelouche/Unity-SkillForge --skill coreclr-gc-watchdog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses performance issues in Unity 6+ caused by the Garbage Collector (GC) by identifying and eliminating memory allocation hot-spots in your code.

Core Features & Use Cases

  • GC Pressure Auditing: Detects and diagnoses sources of GC pressure using Profiler data.
  • Zero-Allocation Patterns: Provides and applies patterns to write memory-efficient code.
  • Use Case: When your Unity game experiences frame rate drops due to GC spikes during gameplay, this Skill helps you pinpoint the exact code causing the allocations and refactor it for optimal performance.

Quick Start

Use the coreclr-gc-watchdog skill to audit the 'Assets/Scripts/MySystem.cs' file for GC allocations.

Frequently Asked Questions about coreclr-gc-watchdog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix GC spikes causing frame rate drops in Unity 6?

To fix GC spikes in Unity 6, audit your C# code to identify memory allocation hot-spots in hot paths. Refactoring identified code using zero-allocation patterns eliminates the Garbage Collector pressure causing the frame rate drops.

What are the best zero-allocation patterns for CoreCLR Unity C# code?

The best zero-allocation patterns for CoreCLR include pre-allocating collections, utilizing StringBuilder for string manipulation, and caching delegates. These patterns prevent runtime memory allocations in critical systems.

How do I use the Unity Profiler to diagnose GC pressure?

You diagnose GC pressure by using the Unity Profiler to capture accurate runtime data, which pinpoints exact code sources causing allocations. This verification also confirms performance improvements after applying zero-alloc patterns.

Can I use this approach to achieve zero bytes allocated per frame in Unity?

Yes, you can achieve zero bytes allocated per frame by auditing critical systems for allocation sources and refactoring them. Applying patterns like pre-allocating collections and caching delegates targets this exact zero-allocation result.

Does this GC optimization technique work with Unity 6 CoreCLR runtime?

Yes, this GC optimization technique specifically targets the Unity 6+ CoreCLR runtime. It audits C# code within this environment to detect and eliminate Garbage Collector pressure using memory-efficient patterns.