Memory Zones
Five graduated zones. Each triggers a proportional response to memory pressure.
Zone Thresholds
| Zone | Default Threshold | Actions |
|---|---|---|
| Green | 0 – 60% | Normal operation. Quality upgrades allowed. |
| Yellow | 60 – 75% | Auto-downgrade quality. Block new high-quality loads. |
| Red | 75 – 85% | Freeze all non-visible iframes. Minimal quality. |
| Critical | 85 – 95% | Single iframe active. All others frozen. |
| Emergency | 95%+ | 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