rungwiroon/BlazorGoogleMaps

Map pages consumes a lot of Memory in browser

turner11 opened this issue · 2 comments

When I plot a lot of circles, the browser task manager shows that the memory footprint of the page gets high very quickly.
In this pull request, I implemented the IAsyncDisposable pattern as per MS documentation in order to try and reclaim the memory, but even after everything is disposed the memory stays high.

I suspect that items on the JavaScript side are not being disposed properly, but I'm afraid its a bit out of my comfort zone.

I have added a demo page for reproducing the issue (/dispose-circle-list)
Examples:

Memory before plotting:
image

Memory After plotting 6k circles:
image

Memory after plotting 6k circles and disposing circles & map:
image

Sadly not enough time to help.

This is a somewhat known issue if I am not mistaken, see #191 with a difficult solution and not a lot of time going around to fix it.