Shiny exited normally with code 137, signal 9 (SIGKILL)

Viewed 1010

I'm trying to deploy a Shiny app to shinyapps.io and i'm coming across the message: "exited normally with code 137, signal 9 (SIGKILL)". The app runs fine locally and takes under 1 minute to load.

I thought this was coming from the size of some files i'm uploading as part of the bundle, they are over 1Gb and i'm limited to 1Gb (as per this post). So i changed this bit in the code (after zipping the heavy files, making the total size way below the 1Gb limit)

files <- list.files('dpe/', pattern = "csv")
dpe <- data.frame()
for (i in files) {
    current_DF <- fread(paste0("dpe/",i))
    current_DF$date_arrete_tarifs_energies <- as.IDate(current_DF$date_arrete_tarifs_energies)
    dpe <- rbind(dpe,current_DF)
}
rm(current_DF)

to this:

unzip("dpe/Archive.zip")
files <- list.files(pattern = "csv") 
dpe <- data.frame()
for (i in files) {
    current_DF <- fread(i)
    current_DF$date_arrete_tarifs_energies <- as.IDate(current_DF$date_arrete_tarifs_energies)
    dpe <- rbind(dpe,current_DF)
}
rm(current_DF)

Note: apparently, when unzipping, the files end up in the root folder of the app (link)

I still get the same error message... I'm not sure i'm interpreting this message correctly. Any thoughts? What are my options?

1 Answers

I had the exact same issue and one of the solutions was indeed to buy a paid plan and increasing the "Instance Size" in the "Settings" tab of the Shiny App general dashboard (or indicating it manually through the "size" argument in rsconnect::configureApp()).

However, I also solved this issue by loading in R all CSV, XLSX files I was using, and then saving them as RDS files with saveRDS(). Then, you can load them with readRDS(). This will not reduce memory within R, but will substantially reduce the size of your files (in my case by almost one-third), allowing you to be below the bundle size limit and able to deploy with the free paid plan of Shiny Apps.

Since you mentioned that the files end up in the root folder of the app, this may help you as it did in my case.

Related