Memory Zones

Five graduated zones. Each triggers a proportional response to memory pressure.

Zone Thresholds

ZoneDefault ThresholdActions
Green0 – 60%Normal operation. Quality upgrades allowed.
Yellow60 – 75%Auto-downgrade quality. Block new high-quality loads.
Red75 – 85%Freeze all non-visible iframes. Minimal quality.
Critical85 – 95%Single iframe active. All others frozen.
Emergency95%+Destroy low-priority iframes. Force cleanup.

Custom Thresholds

new IframeShield({
  watermark: {
    greenMax: 0.5,    // Yellow starts at 50%
    yellowMax: 0.65,  // Red starts at 65%
    redMax: 0.8,      // Critical starts at 80%
    criticalMax: 0.9, // Emergency starts at 90%
  },
});

Reading the Zone

shield.getMemoryZone();    // 'green' | 'yellow' | 'red' | 'critical' | 'emergency'
shield.getStats().memoryZone; // same