You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you open a Flux subscription, you are also responsible for eventually closing the subscription. Failing to do so may lead to leaking memory both in the browser and on the server. The problem is that application developer might not be aware that they need to do this.
Describe the solution you'd like
We could register any opened subscription in a FinalizationRegistry and unregister them when the subscription is closed. If we ever receive an event from the registry, then we would log a warning to the developer.
We could also trigger a proper disconnection at that point but that would lead to issues with existing code that have a "singleton" subscription that is supposed to remain open until the application is closed. Such cases would not have any need to store a reference to the subscription which in turn means that it would be immediately garbage collected and thus also closed.
Describe alternatives you've considered
Let buggy applications leak memory.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe your motivation
When you open a Flux subscription, you are also responsible for eventually closing the subscription. Failing to do so may lead to leaking memory both in the browser and on the server. The problem is that application developer might not be aware that they need to do this.
Describe the solution you'd like
We could register any opened subscription in a
FinalizationRegistry
and unregister them when the subscription is closed. If we ever receive an event from the registry, then we would log a warning to the developer.We could also trigger a proper disconnection at that point but that would lead to issues with existing code that have a "singleton" subscription that is supposed to remain open until the application is closed. Such cases would not have any need to store a reference to the subscription which in turn means that it would be immediately garbage collected and thus also closed.
Describe alternatives you've considered
Let buggy applications leak memory.
Additional context
No response
The text was updated successfully, but these errors were encountered: