Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

High Application Memory Usage #760

Closed
agubler opened this issue Nov 9, 2017 · 3 comments
Closed

High Application Memory Usage #760

agubler opened this issue Nov 9, 2017 · 3 comments

Comments

@agubler
Copy link
Member

agubler commented Nov 9, 2017

Enhancement

Some of the mechanisms that widget-core leverages currently significantly contribute to the memory footprint of a running application. From an initial investigation extending from Evented and Destoryable and leveraging own, on, and emit internally in the widget mechanism contribute an unreasonably high portion towards this footprint.

Child widgets are no longer own'd by their parent (owing to another memory issue documented here #745) and as a result nothing they own will be explicitly destroyed as they will never be destroyed themselves. Therefore there should be no impact on functionality and garbage collection widgets no longer own any of there resources, thus leaving it to the browser garbage collectors to identify when an instance no longer has any references.

Currently the eventing mechanism is used by widget-core to propagate an invalidate event up the widget tree to the projector and to "notify" widgets when elements and the widget themselves have completed their render (meta and onElementCreated/onElementUpdated).

Finally there are some references that are automatically created on widget construction but will not always be used

Proposal(s):

Remove Evented and Destroyable from the WidgetBase inheritance chain (and all current own calls) replacing with an optional constructor argument for a parents invalidate function. This function will be used in the same way that the current invalidated event emitted, by calling it if one exists.

Expose nodeHandler, onElementCreated and onElementUpdated from WidgetBase that will be called directory from vdom to inform the widget of these events.

Identify widget instances/resources that do not need to be created on construction and can be lazily constructed on first usage, for example this._registry and this._metaMap.

@edhager
Copy link
Contributor

edhager commented Nov 10, 2017

Same as #745?

@kitsonk kitsonk added this to the beta.4 milestone Nov 13, 2017
@agubler
Copy link
Member Author

agubler commented Nov 13, 2017

@edhager similar (as in it's in reference to memory usage) but different cause

@agubler
Copy link
Member Author

agubler commented Nov 22, 2017

Addressed by #761 and #763

@agubler agubler closed this as completed Nov 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants