I’ve created a shiny app and am hosting it on the intranet at work. The app has several plots with a lot of data points, so the graphs do consume non-trivial amounts of memory. When the underlying data changes, my app gives the user the option to refreshes these plots by using the new data. The problem is that the app consumes more memory with each refresh, leading me to believe that somehow the memory is not being cleared from plotlyEnv.
A similar issue is disucssed here: https://github.com/rstudio/shiny/issues/1151?_pjax=%23js-repo-pjax-container
I couldn’t get the hack mentioned in the above to work. My question is this: is there a way to clear the graphs from plotlyEnv from within the code so that refreshing the plots does not keeping increasing the memory usage? Any suggestions would be appreciated