MandalaConsulting.Memory
0.0.5
dotnet add package MandalaConsulting.Memory --version 0.0.5
NuGet\Install-Package MandalaConsulting.Memory -Version 0.0.5
<PackageReference Include="MandalaConsulting.Memory" Version="0.0.5" />
<PackageVersion Include="MandalaConsulting.Memory" Version="0.0.5" />
<PackageReference Include="MandalaConsulting.Memory" />
paket add MandalaConsulting.Memory --version 0.0.5
#r "nuget: MandalaConsulting.Memory, 0.0.5"
#:package MandalaConsulting.Memory@0.0.5
#addin nuget:?package=MandalaConsulting.Memory&version=0.0.5
#tool nuget:?package=MandalaConsulting.Memory&version=0.0.5
MandalaConsulting.Memory
A .NET library providing memory management utilities for optimizing application performance through controlled garbage collection.
Overview
The MandalaConsulting.Memory library offers utilities to manage and optimize memory usage in .NET applications. It provides controlled garbage collection mechanisms to help return unused memory to the operating system.
Installation
Install via NuGet:
dotnet add package MandalaConsulting.Memory
Usage
GarbageCollection Class
The GarbageCollection
class provides methods to perform manual garbage collection and attempt to return unused memory to the operating system.
using MandalaConsulting.Optimization.Memory;
// Create a new instance
var gc = new GarbageCollection();
// Perform garbage collection
gc.PerformGarbageCollection(null);
Key Features
- Manual Garbage Collection: Triggers garbage collection on demand
- Memory Return to OS: Attempts to return unused memory back to the operating system
- No-GC Region Management: Uses .NET's no-GC region feature to optimize memory return
How It Works
- Garbage Collection: Calls
GC.Collect()
and waits for pending finalizers - Memory Assessment: Checks total memory usage
- No-GC Region: Attempts to create a no-GC region to facilitate memory return
- Memory Release: Ends the no-GC region, triggering memory return to the OS
Best Practices
- Use sparingly - manual garbage collection can impact performance
- Best suited for scenarios where large amounts of memory need to be released
- Consider using after completing memory-intensive operations
- Monitor application performance when implementing manual GC
Requirements
- .NET Standard 2.0 or higher
- Compatible with .NET Core 2.0+ and .NET Framework 4.6.1+
License
Copyright © 2023 Mandala Consulting, LLC. All rights reserved.
Author
Created by Alexander Fields
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on MandalaConsulting.Memory:
Package | Downloads |
---|---|
MandalaConsulting.APIMiddlewares
Middlewares for APIs - MandalaConsulting.APIMiddlewares |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.0.5 | 231 | 7/5/2025 |
0.0.4 | 514 | 6/8/2025 |
0.0.3 | 200 | 6/8/2025 |
0.0.3-develop.8 | 170 | 6/8/2025 |
0.0.2 | 585 | 10/15/2024 |
0.0.2-develop.7 | 167 | 6/8/2025 |
0.0.1 | 127 | 10/15/2024 |