-
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
R shiny memory leak with observeEvent / flashing app #1591
Comments
TL;DR: The second way is definitely the right way to do it. If you want to disable the grey-on-invalidation mechanism, just add this line to your tags$style(type="text/css", ".recalculating {opacity: 1.0;}") Although, the grey-on-invalidation mechanism (flashing) is actually meaningful. The plots become grey the moment they are invalidated (which in your case means when A couple of other things:
This becomes extremely obvious when you run the following app that makes the same mistake, and then look at its reactive log. Here are the instruction for doing so:
Hope this was helpful, but I'd really recommend watching Joe's tutorial about Effective Reactive Programming to avoid getting bitten by this sort of thing in the future. |
One more important thing: I would not expect the use of In any case, the parallelization would only effect the assignment of output values, not the actual computation of new plots when those You shouldn't be replacing the output values (like |
Thank you for this! It's a livesaver: tags$style(type="text/css", ".recalculating {opacity: 1.0;}") In my opinion, this is one of the worst design decisions in R Shiny. "Blinking" plots, I think, are naturally assumed to be due to a memory leak / rendering issue, not an "invalid data" issue by the end-user. Users do not see a dimmed plot and assume the data is being updated, they see a dimmed plot and assume that you're plotting program has crashed / is eating too much memory to render the plot. This sends the wrong signal and should not be the default behaviour. |
Hello, I want to plot 30 random time series when the variable doPlot is changed.
To reproduce my problem in the following code doPlot is set in the app while in my real app it will be changed by a server client architecture from outside.
Using observeEvent produces a memory leak and my alternative
flashes while calculating but has no memory leak.
How to combine no memory leak and no flashing?
Can anybody help?
Thank you!!!
The text was updated successfully, but these errors were encountered: