♻️ Refactor: cleanupMarkers util eingeführt für alle Marker-Typen + Feature: Heap-Memory-Monitoring über Redux-Slice mit Auto-Reload bei >8GB

This commit is contained in:
ISA
2025-06-06 11:36:06 +02:00
parent 1ec0a8a611
commit 51d2d58f8e
6 changed files with 67 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ import useDataUpdater from "@/hooks/useDataUpdater";
import { cleanupPolylinesForMemory } from "@/utils/polylines/cleanupPolylinesForMemory";
import { cleanupMarkers } from "@/utils/common/cleanupMarkers";
import { monitorHeapAndReload } from "@/utils/common/monitorMemory";
import { monitorHeapWithRedux } from "@/utils/common/monitorMemory";
//-----------------------------------------------------------------------------------------------------
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
//-------------------------------
@@ -787,6 +788,12 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
return () => clearInterval(interval); // wichtig: aufräumen!
}, []);
//--------------------------------------------
useEffect(() => {
const interval = monitorHeapWithRedux(10000); // alle 10s
return () => clearInterval(interval);
}, []);
//---------------------------------------------
//--------------------------------------------
return (