Closed fragsalat closed 6 years ago
I am no expert of this, but I think I can reproduce the issue, seeing JS Heap keep growing.
@EisenbergEffect @davismj ping
PS: @EisenbergEffect it would be nice to have a maintainers file in each repo to know who's responsible and to not ping you for every issue :D
This is a good idea. @davismj is it ok if I list your GitHub alias as lead for this repo with @bigopon as a second?
For vNext, we'll probably be able to take advantage of protected branches and code owners better as well. In both cases, we can document the primary contacts though.
I actually could find out that the cause of the memory leak is bluebird and not the router. Bluebird holds the navigationInstructions in a CaptureTrace object which is not cleared up.
@EisenbergEffect Yes, of course.
@fragsalat Thanks for the update! Appreciate the follow up.
@fragsalat do you have a bug report to bluebird? or do you have some work around in aurelia app? Since majority of aurelia apps use bluebird, this could affect many users.
I just removed Bluebird as I don't need and like it anyway^^ Sry I've not searched for another solution.
I'm submitting a bug report
Please tell us about your environment:
Operating System: Ubuntu 18.04
Node Version: 10.7.0
NPM Version: 6.1.0
JSPM OR Webpack AND Version webpack used by aurelia cli
Browser: all
Language: ESNext
Current behavior: Custom elements are not cleaned up by the garbage collector because the router / container doesn't release the references. Therefore every time the page is shown a new instance of the custom element is rendered. An example path looks like instruction.viewPortInstructions.default.controller.view.controllers[0].viewModel = CustomElement
Expected/desired behavior: Custom elements should be de-referenced when calling unbind or deactivate so that the garbage collector can clean them up regardless how many times I navigate back and forward.
Helpful: I prepared and tested based on a clean aurelia cli setup and just submitting everything. I uploaded the project here https://github.com/fragsalat/demos/tree/master/aurelia-memory-leak
How to reproduce:
I hope you know what would be a good solution. In my application several custom elements have a big tree and every page reload around 3mb are added to the heap^^