-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Terrific memory leaks on remounting #29
Comments
I've actually already been solving an issue like that in a project of mine. But I used native gmaps js API. |
Hey @vintlucky777, Personally I never had any memory-related problems with the Google Maps in my applications but I found the issue. If you could submit a PR it would be great, in the meanwhile I'll try to reproduce it. Have a nice day! |
Any updates on this @vintlucky777? |
@MicheleBertoli I still find the only solution to actually work is the one when you manually keep the references to gmaps DOM-node and try to reutilize it as much as possible. |
Hi @vintlucky777 / @MicheleBertoli. Any progress with this issue? I've come up against this happening as well now. I'll go ahead and have a look at what the issue is but don't want to redo anything that's already been sorted out. |
Hey @dstockdale, I'm really interested in fixing the issue as well. |
Hello @dstockdale and @vintlucky777, Running this script 100 times on the current master gives the following results: While running it on the memory-leak branch gives this: I still want to clean the code up a little bit before merging and publishing the new version on |
Hi @MicheleBertoli sorry I've been having a bit of a nightmare with a project going gnarly on me but looks good. I'll test it out tomorrow and let you know how what I was working on runs with it. |
Thank you very much @dstockdale, you can install it with The only problem is that when you recycle a previously created map, you get a map with all the options you applied before. For example, if you set a custom style or you hide some controls you are going to get a map with those styles and controls all the time. |
Is this fixed in the master branch now? |
Hello @sonsoleslp, this branch has never been merged because it needed proper testing and feedback, but please keep in mind that the "memory leaking" problem is due to the Google Maps SDK (not this package) and it happens only in some particular scenario (for example, it never happened to me - and I used this packaged in production). |
Closing due to inactivity. |
Memory leaks on frequently remounting components
In the case when we use a react-gmaps, say, in kind of "details-view" component, that will mount and unmount frequently, gmaps lead to huge memory leaks.
The good way would be to use a single instance of gmaps, accociated with DOM id of the parent element.
Moreover to that, to support hot-reloading, this instance can be stored in the
window
scope, and taken from there on component mountThe text was updated successfully, but these errors were encountered: