# \[Metal\]\[Mac\] FMetalResourceHeap allocates 512 MB MTLHeap blocks and never frees an empty block: graphics memory only ever grows in 512 MB steps

**URL:** <https://forums.unrealengine.com/t/metal-mac-fmetalresourceheap-allocates-512-mb-mtlheap-blocks-and-never-frees-an-empty-block-graphics-memory-only-ever-grows-in-512-mb-steps/2845989>\
**Category:** Issues and Bug Reporting (Unreal Engine)\
**Tags:** unreal-engine\
**Created:** [October 28, 2026, 3:24am UTC](https://forums.unrealengine.com/t/metal-mac-fmetalresourceheap-allocates-512-mb-mtlheap-blocks-and-never-frees-an-empty-block-graphics-memory-only-ever-grows-in-512-mb-steps/2845989 "2026-10-28T03:24:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![parrykhai](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@parrykhai](https://forums.unrealengine.com/u/parrykhai)\
**Post date:** [October 28, 2026, 3:24am UTC](https://forums.unrealengine.com/t/metal-mac-fmetalresourceheap-allocates-512-mb-mtlheap-blocks-and-never-frees-an-empty-block-graphics-memory-only-ever-grows-in-512-mb-steps/2845989/1 "2026-10-28T03:24:33Z")

</div>

### Summary

On macOS, EMetalFeaturesHeaps is set unconditionally (MetalDevice.cpp around line 348: the -metalheap / rhi.Metal.ForceNoHeap check is inside #if !PLATFORM\_MAC), so every texture and buffer is sub-allocated from an FMetalResourceHeap. In MetalBuffer.cpp:

- METALHEAP\_DEFAULT\_BLOCKSIZE is a compile-time constant of 512 MB on Mac (line 1580; 128 MB on iOS, line 1583).
- FindOrAllocateBlock (line 1684) creates a new MTLHeap block when no free range fits.
- FreeBlock (line 1586) only returns ranges to the free list and merges neighbours. A block whose whole range is free again is never released.

No console variable, ini setting or command-line switch changes the block size or releases empty blocks on Mac (rhi.Metal.ResourcePurgeInPool and the texture pool apply only to the no-heap path; rhi.Metal.HeapBufferBytesToCompact is for buffers).

Engine: 5.8.3 launcher build (CL 58210709). Suggested fix: use a smaller block size on Mac (128 MB, as on iOS) or make it a console variable, and release a block’s MTLHeap in FreeBlock when its free list merges back into the whole block (keeping one spare block per resource-option list).

### What Type of Bug are you experiencing?

Rendering (Graphics / Niagara)

### Steps to Reproduce

1. Package a project with a large streamed world for Mac.
2. Fly or drive through the world so texture streaming loads and unloads a lot, then return to a quiet area.
3. Compare `memreport -full` (Metal heap stats) or `footprint` before and after.

### Expected Result

When streamed textures are unloaded, empty heap blocks go back to the OS (perhaps keeping one spare), so graphics memory follows actual use.

### Observed Result

The graphics high-water mark only grows, in whole 512 MB steps, and varies run to run (4.40 / 4.91 / 5.43 GB peaks in the same test). Lowering r.Streaming.PoolSize does not reliably lower it. On a 16 GB M3 MacBook Air (macOS 26.6.2, UE 5.8.3 packaged Development build) the process peaks at 6.8-6.9 GB in a city fly-through.

Other developers report the same symptom: Apple Developer Forums thread [Security Verification](https://developer.apple.com/forums/thread/812368) (January 2026, UE 5.4-5.7, “Metal heap blocks are never returned”); Apple’s engineers replied that their own Metal heap sample does not reproduce it and suggested reporting it to Epic.

Related Mac Metal memory reports: [[Metal][Mac] FMetalDescriptorHeap destructor is empty: every FlushPendingDescriptorUpdates leaks an FRHIHeapDescriptorAllocator + FMetalRHIBuffer (steady memory growth on METAL\_SM6)](https://forums.unrealengine.com/t/metal-mac-fmetaldescriptorheap-destructor-is-empty-every-flushpendingdescriptorupdates-leaks-an-frhiheapdescriptorallocator-fmetalrhibuffer-steady-memory-growth-on-metal-sm6/2845987) and [[Metal][Mac] FMetalViewport::PresentDrawLayers retains LocalDrawable and never releases it: one CAMetalDrawable leaked per presented frame](https://forums.unrealengine.com/t/metal-mac-fmetalviewport-presentdrawlayers-retains-localdrawable-and-never-releases-it-one-cametaldrawable-leaked-per-presented-frame/2845988)

### Affects Versions

5.8

### Platform(s)

Mac
