googlemaps / googlemaps/js-samples

Bug: memory leak on deleting marker

Open
#1,419 1 comment 0 reactions 1 assignee Claimed by @wangela View on GitHub
Dominant language
TypeScript
Stars
805
Forks
836
PR merge metrics
No merged PRs in 30d

Description

### Operating system

Windows 10, 19045.2604

### Browser Version

Chrome 110.0.5481.104

### How severe is the bug?

high

### Bug description

When trying to remove a marker from the map using setMap(null) and set the object and all known references to null, marker stays in memory.

### Steps to reproduce

You can reproduce it with your own example:
https://jsfiddle.net/gh/get/library/pure/googlemaps/js-samples/tree/master/dist/samples/marker-remove/jsfiddle

1. open the url
2. create a heap memory dump in developer tools
3. search for "_.wh". There are four objects
4. click on "delete markers" in jsfiddle
5. click on garbage collector in developer tools
6. create a new heap memory dump in developer tools
7. search for "_.wh". There should be one less, but still four availble.

### Console log output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.