-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible memory leak #1253
Comments
The observer does get destroyed, right? You don't see the "Reactive values On Wed, Jul 20, 2016 at 1:47 PM Winston Chang [email protected]
|
Oops, I forgot to comment out the |
OK that was going to be my next question. So we actually never see that print message at all? |
I made another edit. :/ Try again. |
Whether or not it actually gets triggered doesn't seem to matter. |
Oh OK, now I get it. OK, there's an easy fix here. When the observeEvent's observer is destroyed during teardown, it's destroyed, but not invalidated. Invalidating it will free it for gc. |
Interestingly, we don't even bother saving a reference to the most-recent ctx object in the Observer R6 object. I guess we could...? And clear it out during invalidation? |
* When observer is destroyed, invalidate context. Closes #1253 * Update NEWS
If you run this app and hit the reload button over and over, the memory usage will keep increasing:
If the
observeEvent
is commented out, then memory usage will NOT increase with each reload.Also, if
vals$x
is modified in theonSessionEnded
function, then the memory will not increase with each reload.I think the root of the problem is that
vals$x
keeps a reference to the observer which gets cleared only whenvals$x
changes.The text was updated successfully, but these errors were encountered: