const browserMemoryProfile = { browser: detectBrowser(), // 'chrome' | 'firefox' | 'safari' | 'mobile-chrome' | 'ios-safari' getMemoryInfo() { // Chrome/Edge if (performance.memory) { return { used: performance.memory.usedJSHeapSize, total: performance.memory.totalJSHeapSize, limit: performance.memory.jsHeapSizeLimit }; } // Firefox (about:memory not accessible via JS) // Safari (no direct API) // Would need server-side User-Agent analysis return null; }, estimateBaseline() { const browser = this.browser; // Theoretical baselines from analysis above const baselines = { 'chrome': { min: 85, max: 120 }, 'firefox': { min: 70, max: 105 }, 'safari': { min: 65, max: 100 }, 'mobile-chrome': { min: 55, max: 95 }, 'ios-safari': { min: 40, max: 80 } }; return baselines[browser] || { min: 60, max: 110 }; }, isMemoryHealthy(currentMB) { const baseline = this.estimateBaseline(); const isHigh = currentMB > baseline.max * 1.5; return !isHigh; } }; __ __