Skip to content

Omni Memory Deep Dive

Complete guide to understanding and optimizing macOS memory with Omni CLI and Thunderbolt 4 SSD.

Table of Contents

How macOS Manages Memory

macOS uses several memory management techniques:

  • Compressed Memory: Compresses inactive RAM to free space
  • Swap: Moves inactive data to disk when RAM is full
  • Memory Pressure: Indicator of how hard the system is working to free RAM

You can check current status with:

omni memory status
memory_pressure
vm_stat

Why Use an External SSD

When memory pressure is high, macOS writes swap to the internal SSD. This can:

  • Slow down the system
  • Wear out the internal SSD faster
  • Reduce available internal storage

A fast external Thunderbolt 4 SSD can:

  • Offload swap and cache from internal storage
  • Provide nearly internal-SSD speeds
  • Extend internal SSD lifespan
  • Keep more free space on the main drive

Thunderbolt 4 vs Other Interfaces

Interface Theoretical Speed Real-world Speed Good for Swap?
Thunderbolt 4 40 Gbps ~2,800 MB/s ✅ Excellent
Thunderbolt 3 40 Gbps ~2,500 MB/s ✅ Excellent
USB4 40 Gbps ~2,000 MB/s ✅ Very Good
USB 3.2 Gen 2 10 Gbps ~900 MB/s ⚠️ Acceptable
USB 3.0 5 Gbps ~400 MB/s ❌ Too slow

Setup Strategies

Strategy 1: App Caches on External SSD

Best for most users. Move heavy app caches without modifying system swap:

omni memory cache-move docker
omni memory cache-move gradle
omni memory cache-move npm
omni memory cache-move xcode

Strategy 2: Full Memory Extension

For advanced users with sustained memory pressure:

omni memory setup --disk /Volumes/ThunderboltSSD

This configures monitoring, logging, and prepares the SSD for swap/cache use.

Strategy 3: Developer Workstation

Combine both strategies for maximum benefit:

# Move all dev caches
omni memory cache-move docker
omni memory cache-move gradle
omni memory cache-move npm
omni memory cache-move xcode

# Setup monitoring
omni memory setup --disk /Volumes/ThunderboltSSD
omni memory monitor

For optimal results, use an SSD with:

  • Interface: Thunderbolt 4 or Thunderbolt 3
  • Capacity: At least 1 TB (2 TB recommended for dev workloads)
  • Read/Write Speed: 2,000 MB/s+ sustained
  • DRAM Cache: Yes, for better sustained performance
  • Endurance: 600 TBW or higher for 1 TB models
  • Cooling: Passive or active heatsink for sustained loads

Monitoring Memory Pressure

Use Omni CLI to monitor memory continuously:

omni memory monitor

The log file shows:

[2026-06-22 10:00:00] MEM: ... | SWAP: ... | PRESSURE: ... | DISK: ...

Interpret pressure levels:

Free RAM Status Action
> 50% 🟢 Low None needed
20-50% 🟡 Medium Consider closing apps
10-20% 🟠 High Move caches, reduce workload
< 10% 🔴 Critical Immediate action needed

Moving App Caches

Docker Desktop

# In Docker Desktop settings:
# Resources > Advanced > Disk image location
# Set to: /Volumes/ThunderboltSSD/.mac-memory-optimizer/apps/docker

Xcode DerivedData

# In Xcode: Preferences > Locations > DerivedData
# Set to: /Volumes/ThunderboltSSD/.mac-memory-optimizer/apps/Xcode/DerivedData

Gradle

export GRADLE_USER_HOME=/Volumes/ThunderboltSSD/.mac-memory-optimizer/apps/gradle

npm

npm config set cache /Volumes/ThunderboltSSD/.mac-memory-optimizer/apps/npm-cache

macOS Settings for Best Performance

  1. Disable "Put hard disks to sleep when possible"
  2. System Settings > Energy Saver
  3. This keeps the external SSD responsive

  4. Enable Trim if supported

  5. Modern APFS handles this automatically on Apple Silicon

  6. Keep 20% internal SSD free

  7. macOS needs free space for temporary files and native swap

  8. Eject properly

  9. Always eject the Thunderbolt SSD before disconnecting to avoid data loss

When Not to Use External Swap

Avoid relying entirely on external SSD if:

  • Your SSD is USB 3.0 or slower
  • You frequently disconnect the SSD
  • Your SSD has low endurance (TBW)
  • You work with highly sensitive data on portable drives

In these cases, focus on app cache relocation and RAM upgrade instead.