dotnet
memory_error
ai_generated
true
OutOfMemoryException with available memory remaining
ID: dotnet/memory-fragmentation
75%Fix Rate
80%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 8 | active | — | — | — |
Root Cause
Large Object Heap fragmentation causing OOM despite free memory.
genericWorkarounds
-
90% success Use ArrayPool<T> and MemoryPool<T> to reduce LOH allocations
-
85% success Enable GCSettings.LargeObjectHeapCompactionMode for periodic compaction
Dead Ends
Common approaches that don't work:
-
Force GC.Collect() frequently
78% fail
Degrades performance, doesnt fix fragmentation
-
Increase process memory limit
72% fail
Fragmentation still occurs