# microsoft/Microsoft.IO.RecyclableMemoryStream

A library to provide pooling for .NET MemoryStream objects to improve application performance.

Repository: https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream
Canonical: https://ross.abutalabs.com/products/microsoftiorecyclablememorystream
Language: C#
License: MIT
License Family: permissive
Last push: 2026-08-26T15:21:31+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 8, longevity 100
- inputs: {"age_days": 4238, "days_push": 7, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2145, forks 214 (observed 2026-08-28T04:06:18.655415+00:00)

## What it is
A .NET library that pools MemoryStream buffers to reduce garbage collection pressure and Large Object Heap allocations in performance-critical applications. It is a near drop-in replacement for System.IO.MemoryStream with thread-safe pooling, metrics, and debugging support.

## Use cases
- reduce gen 2 GC pauses in a high-throughput .NET service
- avoid large object heap allocations when serializing large payloads
- replace MemoryStream in a performance-critical application
- track down memory leaks from stream buffer misuse
- pool byte buffers for reading and writing large files

## When to choose
- your .NET app allocates many MemoryStreams and suffers GC pressure
- you need a bounded, thread-safe buffer pool with metrics and logging
- you want a drop-in MemoryStream replacement supporting Span and Memory APIs

## When to avoid
- your workload allocates streams rarely or in small sizes
- you need streams that are thread-safe themselves
- you are not on a supported .NET target

## Facets
- artifact type: library
- maturity: stable
- function: caching, developer-tools, benchmarking
- domain: performance, developer-tools
- platform: dotnet, cross-platform
- tags: memory-pooling, memorystream, garbage-collection, large-object-heap, drop-in-replacement, dotnet

## Member repositories
- microsoft/Microsoft.IO.RecyclableMemoryStream (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:18.655415+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:51:12.364105+00:00, confidence not recorded.
  - readme: https://github.com/microsoft/Microsoft.IO.RecyclableMemoryStream (fetched 2026-08-28T04:06:18.655415+00:00, sha a273fad453ce)
- Data as of 2026-08-30T08:39:29.467469+00:00.
