// Automated test script (run in console) async function stressTest() { const measurements = []; for (let i = 0; i < 20; i++) { // Simulate user workflow await performCRUDCycle(); // Measure if (performance.memory) { measurements.push({ iteration: i, usedJSHeapSize: performance.memory.usedJSHeapSize, totalJSHeapSize: performance.memory.totalJSHeapSize, jsHeapSizeLimit: performance.memory.jsHeapSizeLimit }); } // Wait between cycles await new Promise(r => setTimeout(r, 2000)); } console.table(measurements); return measurements; } // Analyze trend function analyzeMemoryTrend(measurements) { const heapSizes = measurements.map(m => m.usedJSHeapSize); const first = heapSizes[0]; const last = heapSizes[heapSizes.length - 1]; const growth = ((last - first) / first) * 100; console.log(`Heap growth: ${growth.toFixed(2)}%`); if (growth > 50) { console.warn('⚠️ Significant growth detected'); } else { console.log('✅ Heap stable'); } } __ __