-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
I created a simple dashboard, a single plot with plotly and a couple small tables. It works great, but seems to eat about 100MB of memory per hour. Running gc() does not reclaim any memory, so I have to kill R and restart the server twice a day or my 2GB server will run out of memory.
I split the dashboard in two: one with just the plot and other with just the tables. The plotly dashboard is the one consuming 90% of the memory. Any ideas how to further debug?
ui.R
library(shiny)
library(plotly)
syms <- c("A","B","C","D","E")
shinyUI(fluidPage(
sidebarPanel(checkboxGroupInput(inputId="syms", label=NULL, choices=syms, selected=syms)),
mainPanel(plotlyOutput("plot")),
tags$style(type="text/css", ".recalculating {opacity: 1.0;}")
))
server.R
f <- function(input, output, session) {
output$plot <- renderPlotly({
invalidateLater(5000, session)
syms <- paste("`",paste(isolate(input$syms), collapse="`"),sep="")
d <- read.csv(paste("http://127.0.0.1:9897/q.csv?f",syms,sep=""), colClasses=c("factor","integer","POSIXct","numeric"))
ggplotly(ggplot(d, aes(time,px,color=sym,group=bid)) + geom_step())
})
}
shinyServer(f)
Metadata
Metadata
Assignees
Labels
No labels