My web-app (built with lit-element) became slower with each page reload. Started to look for a leak, which appears to be caused by an element that I initialised via a class field like:
export class SearchAutocomplete extends LitElement {
searchInput: TextInput = new TextInput();
...
}
After I remove that line, GC kicks in just fine.
However, this makes me wondering why the above line prevented the tree to become garbage collected?
More over, why memory is still bound to window after reloading the page, shouldn't that be wiped out immediately?
What does actually happen when we reload/hard reload the page, is that juts equivalent to location.reload()
?
Thanks!