feat: check memory usage

This commit is contained in:
amhsirak
2025-03-04 22:39:36 +05:30
parent 0c94132c74
commit 34057f9b13

View File

@@ -161,5 +161,18 @@ export class CanvasRenderer {
}
}
/**
* Checks current memory usage and cleans up if necessary
*/
private checkMemoryUsage(): void {
if (window.performance && (performance as any).memory) {
const memory = (performance as any).memory;
if (memory.usedJSHeapSize > this.memoryThreshold) {
this.cleanupMemory();
}
}
}
}