Microsoft.IO.RecyclableMemoryStream

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

  • 所有者: microsoft/Microsoft.IO.RecyclableMemoryStream
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    2
      比較:

Github星跟蹤圖

Microsoft.IO.RecyclableMemoryStream NuGet Version

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

Get Started

Install the latest version from NuGet (for .NET 4.5 and up)

Install-Package Microsoft.IO.RecyclableMemoryStream

Features

  • The semantics are close to the original System.IO.MemoryStream implementation, and is intended to be a drop-in replacement.
  • Rather than pooling the streams themselves, the underlying buffers are pooled. This allows you to use the simple Dispose pattern to release the buffers back to the pool, as well as detect invalid usage patterns (such as reusing a stream after it’s been disposed).
  • The MemoryManager is thread-safe (streams themselves are inherently NOT thread safe).
  • Each stream can be tagged with an identifying string that is used in logging - helpful when finding bugs and memory leaks relating to incorrect pool use.
  • Debug features like recording the call stack of the stream allocation to track down pool leaks
  • Maximum free pool size to handle spikes in usage without using too much memory.
  • Flexible and adjustable limits to the pooling algorithm.
  • Metrics tracking and events so that you can see the impact on the system.

For more details, refer to the announcement blog post

Build Targets

The code ships utilizing CommonBuildToolset. This provides some build extensions over top of MSBuild to automatically pull
NuGet packages from command line build, etc.

MSBuild 15 is required to build the code. You get this with Visual Studio 2017. Cross-platform builds will be documented
in a future release.

Build targets are: net40, net45, netstandard1.4, netstandard2.1, and netcoreapp2.1.

Testing

Visual Studio 2019 is required for executing the unit tests. Requirements:

  • NUnit test adaptor (VS Extension)
  • Be sure to set the default processor architecture for tests to x64 (or giant allocation test will fail)

主要指標

概覽
名稱與所有者microsoft/Microsoft.IO.RecyclableMemoryStream
主編程語言C#
編程語言C# (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2015-01-26 01:29:12
推送於2025-04-10 16:24:30
最后一次提交2025-04-10 09:23:31
發布數25
最新版本名稱v3.0.1 (發布於 )
第一版名稱v1.1 (發布於 )
用户参与
星數2.1k
關注者數119
派生數206
提交數279
已啟用問題?
問題數136
打開的問題數4
拉請求數207
打開的拉請求數2
關閉的拉請求數32
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?