-
I make a WebGL library that renders some 3D models. I use RxJS to load different parts of the model asynchronuously. 3D models are usually heavy and takes a lot of time so I'm providing abortation feature for users who'd like to stop loading if it takes too long. I tried holding Benchmarking is done systematically over multiple times so it's accurate that merely holding class SomeClass {
foo() {
loadingTask.subscribe(...)
}
} to class SomeClass {
subscriptions: Subscription[]
foo() {
subscriptions = [
loadingTask.subscribe(...)
]
}
} caused the memory issue. Holding Subscription object as a variable must implicitly retain something other .. what could it be? Has anything similar happened to other RxJS users? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
What version of RxJS? I can see an issue that I ought to address in the v7 implementation, but just to be clear, you're talking about holding a subscription to an observable that has either completed, errored or was explicitly unsubscribed, right? Whether or not you hold a subscription to an observable that is currently subscribed will make no difference - except in some degenerate case in which you subscribe to an observable that does nothing and you hold no reference to it. |
Beta Was this translation helpful? Give feedback.
What version of RxJS? I can see an issue that I ought to address in the v7 implementation, but just to be clear, you're talking about holding a subscription to an observable that has either completed, errored or was explicitly unsubscribed, right? Whether or not you hold a subscription to an observable that is currently subscribed will make no difference - except in some degenerate case in which you subscribe to an observable that does nothing and you hold no reference to it.