♻️ 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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user