maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: Memory Leak Issue

Open KristofferEriksson opened this issue 3 years ago • 2 comments

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

iOS, Android

@rnmapbox/maps version

#main

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

When navigating to a screen with a map and then navigating back or to another screen, the map does not unload properly. Every time we're loading a screen with a map in it, the memory adds up until it causes a memory exhaustion crash. This occurs both on iOS and on Android.

Skærmbillede 2023-02-07 kl  14 40 33

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

KristofferEriksson avatar Feb 07 '23 13:02 KristofferEriksson

Sorry for the duplicate post: https://github.com/rnmapbox/maps/issues/2591 GitHub responded with Error 500 on my first try.

KristofferEriksson avatar Feb 07 '23 13:02 KristofferEriksson

Duplicate of #2591

KiwiKilian avatar Feb 07 '23 20:02 KiwiKilian