dotnet-gc-memory

Tune .NET Garbage Collection modes, heaps, and pooling strategies.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-gc-memory-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-gc-memory
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-gc-memory
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-gc-memory-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers understand and tune the .NET Garbage Collector (GC) and memory management to improve application performance and reduce memory footprint.

Core Features & Use Cases

  • GC Tuning: Configure GC modes (workstation/server, concurrent/non-concurrent) and understand generational collection.
  • Heap Management: Optimize Large Object Heap (LOH) and Pinned Object Heap (POH) usage, and leverage pooling with ArrayPool<T> and MemoryPool<T>.
  • Use Case: A web application is experiencing high latency due to frequent GC pauses. This Skill can guide you to switch to Server GC, tune generation budgets, and implement object pooling to reduce GC pressure and improve response times.

Quick Start

Explain the difference between Workstation and Server GC in .NET.

Frequently Asked Questions about dotnet-gc-memory

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

FAQPage Schema
How do I reduce high latency caused by frequent .NET garbage collection pauses?

To reduce frequent .NET garbage collection pauses, configure Server GC, tune generation budgets, and implement object pooling using ArrayPool<T> to minimize memory pressure and improve response times.

What is the difference between Workstation and Server GC in .NET?

Workstation GC is optimized for client applications with a single heap, while Server GC creates a separate heap and thread per CPU to maximize throughput for high-load server applications.

How do I optimize Large Object Heap (LOH) usage in .NET to prevent memory fragmentation?

Optimize Large Object Heap (LOH) usage by minimizing large allocations, reusing arrays via ArrayPool<T>, and leveraging the Pinned Object Heap (POH) to prevent memory fragmentation and reduce GC overhead.

Can I use dotMemory and PerfView to profile .NET memory pressure and identify GC tuning opportunities?

Yes, you can use dotMemory and PerfView to profile .NET memory pressure. These profiling techniques identify allocation hotspots, analyze generational collection behavior, and reveal GC tuning opportunities.

When should I use ArrayPool<T> and MemoryPool<T> for .NET memory management?

Use ArrayPool<T> and MemoryPool<T> for .NET memory management when handling frequent temporary allocations to reuse memory buffers, drastically reducing garbage collection pressure and improving performance.