js-samples
js-samples copied to clipboard
Bug: memory leak on deleting marker
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
- open the url
- create a heap memory dump in developer tools
- search for "_.wh". There are four objects
- click on "delete markers" in jsfiddle
- click on garbage collector in developer tools
- create a new heap memory dump in developer tools
- search for "_.wh". There should be one less, but still four availble.
Console log output
No response
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@kd509 Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
-
StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.